Name order is not guaranteed, as object key enumeration is not specified according to the ECMAScript specification. In practice, however, most engines use insertion order to sort an object's keys, thus allowing for deterministic extraction.
If provided null or undefined, the function returns an empty array.
Parameters
value: any
input object
Returns
Array<string>
a list of own enumerable property names
Example
var obj = {
'beep': 'boop',
'foo': 3.14
};
var k = keys( obj );
// e.g., returns [ 'beep', 'foo' ]
Returns an array of an object's own enumerable property names.
Notes
null
orundefined
, the function returns an empty array.