Built-In Class Object
The built-in object class which all objects prototype which acts somewhat like a hash of key/value pairs.
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
Object.count(obj)
Return the number of key/value pairs within an object
|
| <static> |
Object.invert(obj)
Returns a new object with the passed object's keys as the new object's values
and the passed object's values as the keys to those values.
|
| <static> |
Object.keys(obj)
Return an array containing the list of keys within the object
|
| <static> |
Object.merge(deep)
Merges multiple objects together into the first object with a right dominant pattern.
|
| <static> |
Object.values(obj)
Return an array containing the list of values within the object
|
Method Detail
<static>
{Number}
Object.count(obj)
Return the number of key/value pairs within an object
- Parameters:
- {Object} obj
- The object to count
- Returns:
- {Number} The number of pairs in the object
<static>
{Object}
Object.invert(obj)
Returns a new object with the passed object's keys as the new object's values
and the passed object's values as the keys to those values.
- Parameters:
- {Object} obj
- The object to create an inverted object from
- Returns:
- {Object} The inverted object
<static>
{Array}
Object.keys(obj)
Return an array containing the list of keys within the object
- Parameters:
- {Object} obj
- The object to take keys from
- Returns:
- {Array} The array of keys
<static>
{Object}
Object.merge(deep)
Merges multiple objects together into the first object with a right dominant pattern.
This will modify the first object and override methods with the rightmost value.
This method returns the object that was modified, so if you would like a new
object instead of one of your objects being overwritten use `Object.merge({}, ...);`
- Parameters:
- {Boolean} deep Optional, Default: false
- Use a deep object merge
- {Object} ...
- Objects to merge
- Returns:
- {Object} The first object passed to merge
<static>
{Array}
Object.values(obj)
Return an array containing the list of values within the object
- Parameters:
- {Object} obj
- The object to take values from
- Returns:
- {Array} The array of values