Array iteratorsBaseline · Widely available
Arrays are iterable with the for … of statement and enumerable with the methods entries(), keys(), and values().
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since May 9, 2018. Widely available since Nov 9, 2020.
Browser support
DesktopChrome
1–65Not supported
66+Supportedsince Apr 17, 2018
Current: 155Edge
12–13Not supported
14+Supportedsince Aug 2, 2016
Current: 154Firefox
1–59Not supported
60+Supportedsince May 9, 2018
Current: 157Safari
1–9.1Not supported
10+Supportedsince Sep 20, 2016
Current: 27MobileChrome Android
18–65Not supported
66+Supportedsince Apr 17, 2018
Current: 155Firefox Android
4–59Not supported
60+Supportedsince May 9, 2018
Current: 157Safari iOS
1–9.3Not supported
10+Supportedsince Sep 13, 2016
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: Symbol.iterator.
Feature detection
JS · check before using
if ("@@iterator" in Array || ("prototype" in Array && "@@iterator" in Array.prototype)) {
// Array.@@iterator is available
}Sub-features
Support for each part of the feature (4). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Array.@@iterator | 38 | 12 | 36 | 10 | 38 | 36 | 10 |
| Array.entries | 38 | 12 | 28 | 8 | 38 | 28 | 8 |
| Array.keys | 38 | 12 | 28 | 8 | 38 | 28 | 8 |
| Array.values | 66 | 14 | 60 | 9 | 66 | 60 | 9 |