Object static methods
Object.entries()
Returns an array of two-item arrays, each containing an enumerable own string key and its value. Reading values can execute getters. Null and undefined throw TypeError.
Formal Syntax & Structure
javascript syntaxjavascript
Object.entries(object)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| object | object or convertible primitive | Value to enumerate. |
Return Value
Array of key/value arrays
New array of the described fields.
Working Example
Example Snippetjavascript
console.log(JSON.stringify(Object.entries({a:1,b:2})));