Skip to content
Merged
Changes from 2 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* self_counting_sequence_helper() {
for (let n = 1;; ++n) {
yield Array(n).fill(n);
}
}
let repeatedNats = p().flatMap(x => x);
let self_counting_sequence = self_counting_sequence_helper().flatMap(x => x)
```

## prior art
Expand Down