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

add (corrected) for-await-of equivalent example#129

Open
shaunlebron wants to merge 2 commits into
tc39:masterfrom
shaunlebron:patch-1
Open

add (corrected) for-await-of equivalent example#129
shaunlebron wants to merge 2 commits into
tc39:masterfrom
shaunlebron:patch-1

Conversation

@shaunlebron

Copy link
Copy Markdown

Fixed #128 if the correct translated example is desired:


Original example:

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

Equivalent to:

const i = readLines(filePath);
while (true) {
  const {value, done} = await i.next();
  if (done) break;
  console.log(value);
}

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.

1 participant