Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ We should explore how to make this more ergonomic and functional.
let digits = Iterator.concat(lows, [4, 5], highs);
```

For the (rare) case of infinite iterators of iterators, use `flatMap` with the identity function.
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.

```js
function* p() {
function* selfCountingSequenceHelper() {
for (let n = 1;; ++n) {
yield Array(n).fill(n);
}
}
let repeatedNats = p().flatMap(x => x);
let selfCountingSequence = selfCountingSequenceHelper().flatMap(x => x)
```

## prior art
Expand Down