Array.keys
Array.keys
Function
Returns an array of array subscripts.
Syntax
array.keys()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Array | Returns an array of integers from 0 to len - 1. |
Example
items = ['a', 'b'] result = items.keys() // Output: [0,1] print result
Notes
- The original array will not be modified.