Skip to content

Commit

Permalink
doc: reformat for-await-of
Browse files Browse the repository at this point in the history
Instead of `for`-`await`-`of`, prefer `for await...of`.

PR-URL: #28425
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
cjihrig authored and targos committed Jul 2, 2019
1 parent 5c12aab commit 68b29ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ changes:

Create an `AsyncIterator` object that iterates through each line in the input
stream as a string. This method allows asynchronous iteration of
`readline.Interface` objects through `for`-`await`-`of` loops.
`readline.Interface` objects through `for await...of` loops.

Errors in the input stream are not forwarded.

Expand Down Expand Up @@ -556,7 +556,7 @@ rl.on('line', (line) => {

A common use case for `readline` is to consume an input file one line at a
time. The easiest way to do so is leveraging the [`fs.ReadStream`][] API as
well as a `for`-`await`-`of` loop:
well as a `for await...of` loop:

```js
const fs = require('fs');
Expand Down Expand Up @@ -597,7 +597,7 @@ rl.on('line', (line) => {
});
```

Currently, `for`-`await`-`of` loop can be a bit slower. If `async` / `await`
Currently, `for await...of` loop can be a bit slower. If `async` / `await`
flow and speed are both essential, a mixed approach can be applied:

```js
Expand Down

0 comments on commit 68b29ac

Please sign in to comment.