keys()

Gets the keys of a specified value.

This function is valid in v2.13.0 to v2.24.3. This function has been downloaded 66 times.

Parameters

{*} value
Value for which you would like the property names retrieved.
{boolean=} opt_onlyNonEnums Optional
If specified and is not null or undefined but is false-ish, all of the property names (enumerable or not) will be returned. If this is true-ish only the non-enumerable property names will be returned. If this is not given or is null or undefined all of the enumerable property names will be returned.

Returns

{Array}
An array of all of the keys of arrOrObj.

Required Function

This function directly requires the following function which is included automatically:

  • indexOf()
    Gets the index of a specified target value in a string, array or an object. Unlike Array.prototype.indexOf(), this function works for finding NaN and differentiates between -0 and 0.

Requiring Functions

This function is directly required by the following functions:

  • entries()
    Gets an array of pairs (array of length 2) indicating all of the keys and values within a given array or object.
  • values()
    Gets an array of all of the values within a given array or object.