Skip to content

Commit 6045fbb

Browse files
committed
doc: reformat for-await-of
Instead of `for`-`await`-`of`, prefer `for await...of`. PR-URL: #28425 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent d22fbbe commit 6045fbb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/api/readline.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ changes:
322322

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

327327
Errors in the input stream are not forwarded.
328328

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

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

561561
```js
562562
const fs = require('fs');
@@ -597,7 +597,7 @@ rl.on('line', (line) => {
597597
});
598598
```
599599

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

603603
```js

0 commit comments

Comments
 (0)