Skip to content

values

The values() method returns an array of an object's values.

Interactive example

Syntax

typescript
function values<
	GenericValue extends AnyValue
>(
	object: Record<string, GenericValue>
): GenericValue[];

Parameters

  • object: The object or array-like structure whose values you want to retrieve.

Return value

An array containing all the values of the object.

See also

  • keys - Returns an array of an object's keys
  • entries - Returns an array of key-value pairs

Sources

Released under the MIT license.