Skip to content

Commit 463e6f7

Browse files
Name the example inf iterator of iterators sequence (#22)
Co-authored-by: Michael Ficarra <github@michael.ficarra.me>
1 parent 5731124 commit 463e6f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ We should explore how to make this more ergonomic and functional.
5656
let digits = Iterator.concat(lows, [4, 5], highs);
5757
```
5858

59-
For the (rare) case of infinite iterators of iterators, use `flatMap` with the identity function.
59+
For the (rare) case of infinite iterators of iterators, use [`Iterator.prototype.flatMap`](https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator.prototype.flatmap) with the identity function.
6060

6161
```js
62-
function* p() {
62+
function* selfCountingSequenceHelper() {
6363
for (let n = 1;; ++n) {
6464
yield Array(n).fill(n);
6565
}
6666
}
67-
let repeatedNats = p().flatMap(x => x);
67+
let selfCountingSequence = selfCountingSequenceHelper().flatMap(x => x)
6868
```
6969

7070
## prior art

0 commit comments

Comments
 (0)