Object.select()

Given a path, get the key value.

Signature

Object.select(target: Any, path: Array<String>): Any | Null

Description

Given a path, get the key value.

Parameters

Parameter Type Required Description

target

Function

Yes

Source object.

path

Function

Yes

Path to target element.

Return value

Type Description

Any

Value of the element located at path.

Null

The path doesn’t exist.

Examples

Object.select({ a : { b : 'x' } }, ['a', '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!