Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

add for-await-of desugared example to readme #128

Closed
wants to merge 1 commit into from
Closed

add for-await-of desugared example to readme #128

wants to merge 1 commit into from

Conversation

shaunlebron
Copy link

This may be obvious to everyone involved, but can we include the following desugared example in the readme, if correct?


Original example:

for await (const line of readLines(filePath)) {
  console.log(line);
}

Equivalent to:

for (const _ of readLines(filePath)) {
  const line = await _;
  console.log(line);
}

@domenic
Copy link
Member

domenic commented Jun 11, 2018

No, this is not correct. See the third paragraph at https://github.com/tc39/proposal-async-iteration#overview-and-motivation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants