The entries()
method of Array
instances returns a new array iterator object that contains the key/value pairs for each index in the array.
The entries()
method of Array
instances returns a new array iterator object that contains the key/value pairs for each index in the array.
None.
A new iterable iterator object.
When used on sparse arrays, the entries()
method iterates empty slots as if they have the value undefined
.
The entries()
method is generic. It only expects the this
value to have a length
property and integer-keyed properties.
The entries()
method reads the length
property of this
and then accesses each property whose key is a nonnegative integer less than length
.
Desktop | Mobile | Server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | Deno | Node.js | ||
entries |
38 | 12 | 28 | 25 | 8 | 38 | 28 | 25 | 8 | 3.0 | 38 | 1.0 | 0.12.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries