then()
is called, when the promise gets fulfilled (resolved or rejected), i.e. the callback does not throw an error. The difference between resolve()
and reject()
is that resolve()
will trigger the first callback in then()
and reject()
will trigger the second callback (if one was defined).Any errors you throw inside a callback will trigger the callback in
catch()
.https://developer.mozilla.org/en-US/docs/Web/JavaSc...
Leave a comment: