---
url: "https://web.dev/blog/baseline-iterator-helpers"
titulek: "Iterator helpers have become Baseline Newly available | Blog | web.dev"
h1: "Iterator helpers have become Baseline Newly available Stay organized with collections Save and categorize content based on your preferences."
popis: "Iterator helpers became Baseline Newly available as of March 31, 2025."
jazyk: "en"
kanonicka: "https://web.dev/blog/baseline-iterator-helpers"
drobecky: ["Blog", "Iterator helpers have become Baseline Newly available"]
zdroj: "live"
wayback_snapshot: ""
stazeno: "2026-09-14 01:49:48"
znaku: 5761
slov: 600
kodovani: "iso-8859-2"
sha256: "a9e32adbd2e0c80e7c13297e50a93f2ab0e0818a480ae56b6da4f9e4630bbe6e"
---
Iterator helpers have become Baseline Newly available
Stay organized with collections
Save and categorize content based on your preferences.
Jeremy Wagner
Published: May 1, 2025
If you write JavaScript, then iterating is something you do a lot of. You're either writing loops to work with arrays, or using functional programming methods such as [`map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map), [`filter`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) and other similar methods to process all sorts of data. One sticking point with using these methods however, is that they're only available on arrays. If you wanted to use them on an iterable, you'd have to convert it to an array, and then call the method you'd need. This can be wasteful, or in cases where the iterable represents contains infinite dataset using [generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*), it isn't possible. However, now that iterator helpers have become Baseline Newly available, this ability is finally available across browsers. How do iterator helpers work? Iterator helpers are exposed by defining new methods on the [`Iterator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object's `prototype`. These methods align with many functional programming methods you're used to using, such as [`map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/map), [`filter`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter), [`reduce`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce), and other similar methods. For example, you could use an iterator helper on the `filter` method to filter list items by the contents of their `innerText` property for a collection of DOM nodes, which you can then use later in a `for` loop: `const posts = document.querySelectorAll("ul#specific-list > li") .values() .filter(item => item.textContent.includes("kiwi")); // For-of loops can only be used on iterables, which `posts` is! for (const post of posts) { console.log(post.textContent); }` In the preceding code snippet, the iterator helper method for `filter` is used to iterate over all `
` elements in a specific `` element. The filtering criteria is that each element's text content must contain a substring of `"kiwi"`. Iterator helpers can also be used with generator functions. In this example, a generator function that calculates [factorials](https://en.wikipedia.org/wiki/Factorial), but uses the iterator helper to filter out values to ones that are divisible by 8, and log the first five filtered values to the console: `function* factorials (n) { let result = 1; for (let i = 1; i <= n; i++) { result *= i; yield result; } } const filteredFactorials = factorials(128).filter(x => x % 8 === 0); console.log(filteredFactorials.next().value); console.log(filteredFactorials.next().value); console.log(filteredFactorials.next().value); console.log(filteredFactorials.next().value); console.log(filteredFactorials.next().value);` In particular, the preceding code snippet is an example of something that wouldn't be possible without iterator helpers, because the number of factorials is infinite, and not something you can convert to an array otherwise! Depending on your situation, iterator helpers have a lot of potentialâ and they're available for each of these iterable methods: [`drop`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/drop) [`every`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/every) [`filter`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter) [`find`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/find) [`flatMap`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/flatMap) [`forEach`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/forEach) [`map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/map) [`reduce`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce) [`some`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/some) [`take`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/take) [`toArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) The possibilities for iterator helper use cases are vast, and can provide a significant boost in developer ergonomics. Now that they're Baseline Newly available, you should have increasing confidence over time that you can use them without fear of compatibility issues. For more information, check out the following resources: [Iterator helpers on the V8 blog](https://v8.dev/features/iterator-helpers). [Iterator helper methods list on MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Iterator#instance_methods). [Iterator helpers TC39 proposal](https://github.com/tc39/proposal-iterator-helpers). Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates. Last updated 2025-05-01 UTC.