experimental.objectKeys() function

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"

  o: {key1: "value1", key2: "value2"}

// Returns [key1, key2]



The object to return keys from.

Data type: Object


Return all keys in an object

import "experimental"

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

experimental.objectKeys(o: user)

// Returns [firstName, lastName, age]

This documentation is open source. See a typo? Please, open an issue.

Need help getting up and running? Get Support