Object.fromEntries()

Create an object of given array elements.

Signature

Object.fromEntries(source: Array<[String, Any]>): Any

Description

Create an object of given array elements.

Parameters

Parameter Type Required Description

source

Function

Yes

An Array.

Return value

Type Description

Any

Object of source array elements.

Examples

This example has type checking disabled:

Object.fromEntries([['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!