re: How to implement `Promise.all`? VIEW POST

re: Nice article Jason! Just an FYI — the examples given try to overwrite a const, so that won't run. I think you can make your first example terser...

Oops, another typo spotted! It should have been a let instead. Thanks for pointing it out.

I do think the counter is needed tho as we cannot guarantee the order of which the promises finish. So if the last promise doesn't finish the last, the results array will not be fully populated because of this:

const xs = [];
xs[6] = 3:
xs.length === 7; // true
code of conduct - report abuse