Object.entries()

Get the object key:value pairs as array elements.

Signature

Object.entries(source: Any): Array<Array<Any>>

Description

Get the object key:value pairs as array elements.

Parameters

Parameter Type Required Description

source

Function

Yes

An Object.

Return value

Type Description

Array

Array of elements extracted from source.

Examples

Object.entries({ 'a' : 0, 'b' : 'x' })
[
  [
    "a",
    0
  ],
  [
    "b",
    "x"
  ]
]

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!