3 ms·
Is this not less typing and as clear? console.log('start') doA() .then(doB) .then(doC) .then(() => console.log('finish')) .catch((error) =>
by BeefWellington 5y ago
Is this not less typing and as clear?
console.log('start')
doA()
.then(doB)
.then(doC)
.then(() => console.log('finish'))
.catch((error) => {
console.log(error)
})
- mdaniel 5y agoIt's been my experience that doing it that way can fiddle with the `this` value of those B and C functions, although I do in general agree there's usually no need for the outer wrapping arrow function if the interior one doesn't care about `this` I believe your .catch can similarly be `.catch(console.log)` for the same reason