Object.entries
Object.entries
Function
Returns an array of object entries, each entry being [key, value].
Syntax
object.entries()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Array | Returns an array of entries. |
Example
user = {name: 'BT', age: 1} result = user.entries() // Output: [["name","BT"],["age",1]] print result
Notes
- The order of entries is consistent with the order in which objects are inserted.
- entries do not modify the original object.