Array.entries
Array.entries
Function
Returns an array of entries of the form [index, value].
Syntax
array.entries()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Array | Returns an array of entries. |
Example
items = ['a', 'b'] result = items.entries() // Output: [[0,"a"],[1,"b"]] print result
Notes
- The original array will not be modified.