experimental.objectKeys() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.65 is the most recent stable version of Flux.

The experimental.objectKeys() function is subject to change at any time. By using this function, you accept the risks of experimental functions.

The experimental.objectKeys() function returns an array of keys in a specified object.

Function type: Transformation

The experimental.objectKeys() function is subject to change at any time. By using this function, you accept the risks of experimental functions.

import "experimental"

experimental.objectKeys(
  o: {key1: "value1", key2: "value2"}
)

// Returns [key1, key2]

Parameters

o

The object to return keys from.

Data type: Object

Examples

Return all keys in an object

import "experimental"

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

experimental.objectKeys(o: user)

// Returns [firstName, lastName, age]