Promise
Promise has become an important tool for managing asynchronous operations in
JavaScript. However, sometimes we would still find promises kind of annoying.
Promise
// Here `then` is an equivalence to `Promise.resolve().then`.
.then(() => {
// Start.
})
.then(() => {
if (wantToBreakHere) {
// How?
}
})
.then(() => {
// Something to skip.
});
We may nest the