News for hackers. Stuff that matters.
Re:Examples of everything new in ECMAScript 2016, 2017, and ... by spiralx on Wednesday April 04, 2018 @10:05AM (#16754758)
Your example is equal to

  await getThingAtIndex(1)
  await getThingAtIndex(2)
  await getThingAtIndex(3)
whereas the async for loop is equivalent to

  await Promise.all([
    getThingAtIndex(1),
    getThingAtIndex(2),
    getThingAtIndex(3)
  ])
Your example is valid syntax, but it executes each call synchronously.
Re:Examples of everything new in ECMAScript 2016, 2017, and ... by xeromal on Wednesday April 04, 2018 @01:04PM (#16756681)
The article says `This feature adds a new “for-await-of” loop that allows us to call async functions that return promises (or Arrays with a bunch of promises) in a loop. The cool thing is that the loop waits for each Promise to resolve before doing to the next loop.`. which seems to be in contention with what you say.