nzakas / understandinges6

Content for the ebook "Understanding ECMAScript 6"
5.45k stars 796 forks source link

Confusing/misleading `Promise.all` order explanation #383

Closed tdd closed 7 years ago

tdd commented 7 years ago

Hi Nicholas,

Location: Chapter 11 > Page 234 > "The Promise.all() method" > first par below code

You say “The values are stored in the orider in which the promises resolved”, which is clearly a time-based ordering, and would be terribly harmful / useless if it were true. Values are stored in the order of the promises array passed to Promise.all(), obviously, so we can match per-position, a much more useful (if only for array destructuring of the resolve callback arg) approach.

That is very likely an honest mistake attributable to fatigue 😉

nzakas commented 7 years ago

Yeah, clearly not thinking very well at this point. I'll fix it.