docs-v2/content/flux/v0/stdlib/experimental/objectkeys.md

1.6 KiB

title description menu weight introduced
experimental.objectKeys() function `experimental.objectKeys()` returns an array of property keys in a specified record.
flux_v0_ref
name parent identifier
experimental.objectKeys experimental experimental/objectKeys
101 0.40.0

experimental.objectKeys() returns an array of property keys in a specified record.

Function type signature
(o: A) => [string] where A: Record

{{% caption %}} For more information, see Function type signatures. {{% /caption %}}

Parameters

o

({{< req >}}) Record to return property keys from.

Examples

Return all property keys in a record

import "experimental"

user = {firstName: "John", lastName: "Doe", age: 42}

experimental.objectKeys(o: user)// Returns [firstName, lastName, age]