Array.prototype.entries()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since May 2018.
Сводка
Метод entries()
возвращает новый объект итератора массива Array Iterator
, содержащий пары ключ / значение для каждого индекса в массиве.
Синтаксис
arr.entries()
Описание
js
var arr = ["a", "b", "c"];
var eArr = arr.entries();
console.log(eArr.next().value); // [0, 'a']
console.log(eArr.next().value); // [1, 'b']
console.log(eArr.next().value); // [2, 'c']
Спецификации
Specification |
---|
ECMAScript® 2025 Language Specification # sec-array.prototype.entries |
Совместимость с браузерами
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
entries |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.