Not that it matters because you don't care and no one uses promises any more but it does really sadden me how much nested promise code I've found over the years.
eg this
function sad(input) {
return new Promise((resolve, reject) =>
foo(input).then((data) => {
bar(data).then((data2) => {
baz(data2).then(resolve, reject)
})
})
);
}
could quite as easily have been written like this:
eg this
could quite as easily have been written like this: But no one seemed to be aware that you can return a promise in the `.then()` callback and have it chain neatly...