JavaScript Iterator Methods

About This Index
This page is the JavaScript Iterator Methods index. An Iterator can produce values one by one. Helper methods such as map(), filter() and take() let you transform those values lazily — only when they are needed. Each row below links to a full guide with syntax, examples you can run, and FAQs.
Learn what an Iterator is on /js/iterator. Use this page when you need a specific method such as map() or Iterator.from().
The helpers such as map(), filter(), take() and toArray() are Baseline Newly available (2025). Static methods like Iterator.concat() and helpers like chunks() are even newer. Check with typeof Iterator.prototype.map === "function" (or the matching name) before you rely on them in older environments.
How to Call an Iterator Method
Turn an iterable into an iterator, then chain helpers:
const nums = [1, 2, 3, 4, 5, 6].values();
const result = nums
.filter((n) => n % 2 === 0)
.map((n) => n * 10)
.take(2)
.toArray();
console.log(result); // [20, 40] JavaScript Iterator Methods Table
All method guides in this JavaScript tutorial series (21 tutorials), grouped by what they do.
Create and combine iterators
4 methodsStatic methods on Iterator. Call them as Iterator.from(...), not on an instance.
| Method | Description | Tutorial |
|---|---|---|
Iterator.concat() | Yield values from several iterables, one after another, as a single lazy iterator. | Open |
Iterator.from() | Turn an iterable or a plain iterator into a proper Iterator that has the helper methods. | Open |
Iterator.zip() | Walk several iterables together and yield arrays of matching positions. | Open |
Iterator.zipKeyed() | Like zip(), but each step is an object with the keys you choose. | Open |
Transform values (lazy)
7 methodsThese return a new iterator helper. Values are produced only when you pull them.
| Method | Description | Tutorial |
|---|---|---|
map() | Run a function on each value and yield the results. | Open |
filter() | Keep only the values for which the callback returns true. | Open |
flatMap() | Map each value to an iterable, then yield those inner values one by one. | Open |
take() | Yield only the first N values, then stop. | Open |
drop() | Skip the first N values, then yield the rest. | Open |
chunks() | Split the stream into non-overlapping arrays of a fixed size. | Open |
windows() | Yield a sliding window of N values at a time. | Open |
Search and test
4 methodsThese consume the iterator and return one answer (a value or true/false).
Consume into a result
4 methodsWalk the whole iterator (or stop early) and build a final value.
| Method | Description | Tutorial |
|---|---|---|
forEach() | Run a function for every value. Returns undefined. | Open |
reduce() | Combine all values into one result with a reducer function. | Open |
join() | Turn every value into one string, with an optional separator. | Open |
toArray() | Collect every remaining value into a new Array. A common last step. | Open |
Iterator protocol helpers
2 methodsSpecial methods that make iterators iterable and disposable.
| Method | Description | Tutorial |
|---|---|---|
[Symbol.dispose]() | Closes the iterator (calls return) for use with using / await using. | Open |
[Symbol.iterator]() | Returns the iterator itself so for...of and spread work on it. | Open |
Frequently Asked Questions
Start with Iterator.from()
Open the guide for turning an iterable into a proper Iterator with helpers: syntax, examples, and FAQs.
12 people found this page helpful
