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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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

wants to merge 2 commits into from

Conversation

shaunlebron
Copy link

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.

None yet

1 participant