Object static methods

Object.entries()

Try the free JavaScript compiler

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

NameTypeDescription
objectobject or convertible primitiveValue 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})));
JavaScript Reference