entries()

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

This function is valid in v2.7.0. This function has been downloaded 0 times.

Parameters

{Array|Object} arrOrObj
Array or object to traverse to get all of the key/value pairs.
{boolean=} opt_includeInheritance Optional, Default:false
Indicates whether inherited key/value pairs should be included in the returned array of entries.

Returns

{Array.<Array>}
An array of pairs (arrays where the first item is the key and the second is the value).

Required Functions

This function directly requires the following functions which are included automatically:

  • has()
    Every object descended from Object inherits the hasOwnProperty method. This method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check down the object's prototype chain.
  • isArrayLike()
    Determines if an object is an array or at least array-like.
  • typeOf()
    Either gets the type of a value or adds a constructor registering its custom type name.

Requiring Function

This function is directly required by the following function:

  • invert()
    Creates the inverse of an object by making a new object where the keys are the values and the values are the keys.