Skip to content

Commit 04c0a04

Browse files
committed
fixup! doc: remove assignment in condition in stream doc
1 parent a6a237b commit 04c0a04

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

doc/api/stream.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,11 +1033,10 @@ available, [`stream.read()`][stream-read] will return that data.
10331033
const readable = getReadableStreamSomehow();
10341034
readable.on('readable', function() {
10351035
// There is some data to read now.
1036-
let data = this.read();
1036+
let data;
10371037

1038-
while (data) {
1038+
while ((data = this.read()) !== null) {
10391039
console.log(data);
1040-
data = this.read();
10411040
}
10421041
});
10431042
```

0 commit comments

Comments
 (0)