JSFiddle - React, Tailwind, and code Playground
JavaScript
var prom = Promise.resolve(1);
prom.then(console.log);
prom
.then((value) => {
console.log(value);
return 2;
})
.then(console.log);
prom.then((value) => console.log(value, 'after a non reassigned then'));
prom = prom.then(() => {
return 3;
})
prom.then((value) => console.log(value, 'after a reassigned then'));
prom
.then(() => {
throw 'ack';
})
.catch(console.log);