Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.
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
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,6 @@ result.next(); // {value: 4, done: false};
result.next(); // {value: 5, done: false};
```

### `.indexed()`

`.indexed` takes no arguments. It returns an iterator where each value produced by the underlying iterator is paired with a counter, starting at 0 and increasing by 1 with every element produced.

Returns an iterator of pairs.

#### Example

```JavaScript
const abc = ["a", "b", "c"].values();

const result = abc
.indexed();
result.next(); // {value: [0, "a"], done: false};
result.next(); // {value: [1, "b"], done: false};
result.next(); // {value: [2, "c"], done: false};
```

### `.flatMap(mapperFn)`

`.flatMap` takes a mapping function as an argument. It returns an iterator that produces all elements of the iterators produced by applying the mapping function to the elements produced by the underlying iterator.
Expand Down