Object.keys

Returns the names of the enumerable string properties and methods of an object.

Syntax

keys(object)

Parameters

Return value

An array of strings.

If the object has no enumerable string properties and methods, an empty array is returned.

Examples

Object.keys({cheese: "like", milk: "dislike"})
["cheese", "milk"]