Array iterators
Widely available
Arrays are iterable with the for … of
statement and enumerable with the methods entries()
, keys()
, and values()
.
To learn more, see
Array.prototype[Symbol.iterator](),
Array.prototype.entries(),
Array.prototype.keys(),
Array.prototype.values() at MDN.
Compatibility
- Chrome 66 Released on 2018-04-17
- Chrome Android 66 Released on 2018-04-17
- Edge 14 Released on 2016-08-02
- Firefox 60 Released on 2018-05-09
- Firefox for Android 60 Released on 2018-05-09
- Safari 10 Released on 2016-09-20
- Safari on iOS 10 Released on 2016-09-13
Specifications
- ECMAScript Language Specification (#sec-array.prototype-@@iterator), from TC39 (Ecma International).
- ECMAScript Language Specification (#sec-array.prototype.entries), from TC39 (Ecma International).
- ECMAScript Language Specification (#sec-array.prototype.keys), from TC39 (Ecma International).
- ECMAScript Language Specification (#sec-array.prototype.values), from TC39 (Ecma International).