Something like this should work: function allSettled(promises) { let settled = promises.map(p => p.then( v => ({status: 'fulfilled', value: v}), r => ({status: 'rejected', reason: r}) )); return Promise.all(settled); }…
It took me a bit to dig through the fringe cases to find the combination (or maybe an additional combination?) to pull that off. x = '' y = '-Infinity' z = -1 x < y // true: '-Infinity' (y) doesn't get coerced into a…
Going further with the toolbox analogy... Imagine we have carpenters and brick layers. Two distinct jobs that maybe have some overlap of tools. We decide that we have a lot more carpenters than brick layers, so we'll…
"giving more money to ... will increase inequality." You're defining "income inequality" as only in relation to the median or average income. That is too simple to make any sense. By that model, I could have 1000 people…
Something like this should work: function allSettled(promises) { let settled = promises.map(p => p.then( v => ({status: 'fulfilled', value: v}), r => ({status: 'rejected', reason: r}) )); return Promise.all(settled); }…
It took me a bit to dig through the fringe cases to find the combination (or maybe an additional combination?) to pull that off. x = '' y = '-Infinity' z = -1 x < y // true: '-Infinity' (y) doesn't get coerced into a…
Going further with the toolbox analogy... Imagine we have carpenters and brick layers. Two distinct jobs that maybe have some overlap of tools. We decide that we have a lot more carpenters than brick layers, so we'll…
"giving more money to ... will increase inequality." You're defining "income inequality" as only in relation to the median or average income. That is too simple to make any sense. By that model, I could have 1000 people…