![]()
Adds a key-value pair to the object. Throws an exception if the key is
already in use. Use set if you want to change an existing pair.
|
code » | ||||
![]()
Removes all key value pairs from the object/map/hash.
Arguments:
|
code » | ||||
Does a flat clone of the object.
|
code » | ||||
Whether the object/hash/map contains the given object as a value.
An alias for goog.object.containsValue(obj, val).
|
code » | ||||
Whether the object/map/hash contains the given key.
|
code » | ||||
Whether the object/map/hash contains the given value. This is O(n).
|
code » | ||||
Creates a new object built from the key-value pairs provided as arguments.
Arguments:
Returns: !Object
The new object.
|
code » | ||||
Creates an immutable view of the underlying object, if the browser
supports immutable objects.
In default mode, writes to this view will fail silently. In strict mode,
they will throw an error.
|
code » | ||||
Creates a new object where the property names come from the arguments but
the value is always set to true
Arguments:
Returns: !Object
The new object.
|
code » | ||||
Calls a function for each element in an object/map/hash. If
all calls return true, returns true. If any call returns false, returns
false at this point and does not continue to check the remaining elements.
Arguments:
Returns: boolean
false if any element fails the test.
|
code » | ||||
![]()
Extends an object with another object.
This operates 'in-place'; it does not create a new Object.
Example:
var o = {};
goog.object.extend(o, {a: 0, b: 1});
o; // {a: 0, b: 1}
goog.object.extend(o, {b: 2, c: 3});
o; // {a: 0, b: 2, c: 3}
Arguments:
|
code » | ||||
Calls a function for each element in an object/map/hash. If that call returns
true, adds the element to a new object.
Arguments:
|
code » | ||||
Searches an object for an element that satisfies the given condition and
returns its key.
Arguments:
Returns: string | undefined
The key of an element for which the function
returns true or undefined if no such element is found.
|
code » | ||||
![]()
Searches an object for an element that satisfies the given condition and
returns its value.
Arguments:
Returns: V
The value of an element for which the function returns true or
undefined if no such element is found.
|
code » | ||||
![]()
Calls a function for each element in an object/map/hash.
Arguments:
|
code » | ||||
![]()
Returns the value for the given key.
|
code » | ||||
Returns one key from the object map, if any exists.
For map literals the returned key will be the first one in most of the
browsers (a know exception is Konqueror).
|
code » | ||||
![]()
Returns one value from the object map, if any exists.
For map literals the returned value will be the first one in most of the
browsers (a know exception is Konqueror).
Arguments:
Returns: V | undefined
The value or undefined if the object is empty.
|
code » | ||||
Returns the number of key-value pairs in the object map.
|
code » | ||||
Returns the keys of the object/map/hash.
|
code » | ||||
![]()
Get a value from an object multiple levels deep. This is useful for
pulling values from deeply nested objects, such as JSON responses.
Example usage: getValueByKeys(jsonObj, 'foo', 'entries', 3)
Arguments:
Returns: *
The resulting value. If, at any point, the value for a key
is undefined, returns undefined.
|
code » | ||||
Returns the values of the object/map/hash.
|
code » | ||||
Whether the object/map/hash is empty.
|
code » | ||||
No description.
|
code » | ||||
For every element in an object/map/hash calls a function and inserts the
result into a new object.
Arguments:
|
code » | ||||
Removes a key-value pair based on the key.
|
code » | ||||
![]()
Adds a key-value pair to the object/map/hash.
|
code » | ||||
![]()
Adds a key-value pair to the object/map/hash if it doesn't exist yet.
|
code » | ||||
Calls a function for each element in an object/map/hash. If any
call returns true, returns true (without checking the rest). If
all calls return false, returns false.
Arguments:
Returns: boolean
true if any element passes the test.
|
code » | ||||
Returns a new object in which all the keys and values are interchanged
(keys become values and values become keys). If multiple keys map to the
same value, the chosen transposed value is implementation-dependent.
|
code » | ||||
![]()
Clones a value. The input may be an Object, Array, or basic type. Objects and
arrays will be cloned recursively.
WARNINGS:
goog.object.unsafeClone does not detect reference loops. Objects
that refer to themselves will cause infinite recursion.
goog.object.unsafeClone is unaware of unique identifiers, and
copies UIDs created by getUid into cloned results.
Arguments:
Returns: *
A clone of the input value.
|
code » |