The destination object.
Returns object
.
This method is like _.assign
except that it iterates over own and
inherited source properties.
Note: This method mutates object
.
The destination object.
Returns object
.
This method is like _.assignIn
except that it accepts customizer
which
is invoked to produce the assigned values. If customizer
returns undefined
assignment is handled by the method instead. The customizer
is invoked
with five arguments: (objValue, srcValue, key, object, source).
Note: This method mutates object
.
The destination object.
Returns object
.
This method is like _.assign
except that it accepts customizer
which
is invoked to produce the assigned values. If customizer
returns undefined
assignment is handled by the method instead. The customizer
is invoked
with five arguments: (objValue, srcValue, key, object, source).
Note: This method mutates object
.
The destination object.
Returns object
.
Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be specified as individual arguments or as arrays of keys.
The object to iterate over.
The property names or indexes of elements to pick, specified individually or in arrays.
Returns the new array of picked elements.
Creates an object that inherits from the given prototype object. If a properties object is provided its own enumerable properties are assigned to the created object.
The object to inherit from.
The properties to assign to the object.
Returns the new object.
Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to undefined. Once a property is set, additional values of the same property are ignored.
Note: This method mutates object.
The destination object.
The destination object.
This method is like _.defaults except that it recursively assigns default properties.
The destination object.
The source objects.
Returns object.
This method is like _.find except that it returns the key of the first element predicate returns truthy for instead of the element itself.
The object to search.
The function invoked per iteration.
Returns the key of the matched element, else undefined.
This method is like _.findKey except that it iterates over elements of a collection in the opposite order.
The object to search.
The function invoked per iteration.
Returns the key of the matched element, else undefined.
Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The iteratee is invoked with three arguments: (value, key, object). Iteratee functions may exit iteration early by explicitly returning false.
The object to iterate over.
The function invoked per iteration.
Returns object.
This method is like _.forIn except that it iterates over properties of object in the opposite order.
The object to iterate over.
The function invoked per iteration.
Returns object.
Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is invoked with three arguments: (value, key, object). Iteratee functions may exit iteration early by explicitly returning false.
The object to iterate over.
The function invoked per iteration.
Returns object.
This method is like _.forOwn except that it iterates over properties of object in the opposite order.
The object to iterate over.
The function invoked per iteration.
Returns object.
Creates an array of function property names from own enumerable properties
of object
.
The object to inspect.
Returns the new array of property names.
Creates an array of function property names from own and inherited
enumerable properties of object
.
The object to inspect.
Returns the new array of property names.
Gets the property value at path of object. If the resolved value is undefined the defaultValue is used in its place.
The object to query.
The path of the property to get.
Returns the resolved value.
Checks if path
is a direct property of object
.
The object to query.
The path to check.
Returns true
if path
exists, else false
.
Checks if path
is a direct or inherited property of object
.
The object to query.
The path to check.
Returns true
if path
exists, else false
.
Creates an object composed of the inverted keys and values of object. If object contains duplicate values, subsequent values overwrite property assignments of previous values unless multiValue is true.
The object to invert.
Returns the new inverted object.
This method is like _.invert except that the inverted object is generated from the results of running each element of object through iteratee. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value).
The object to invert.
The iteratee invoked per element.
Returns the new inverted object.
Invokes the method at path of object.
The object to query.
The path of the method to invoke.
The arguments to invoke the method with.
Creates an array of the own enumerable property names of object.
Note: Non-object values are coerced to objects. See the ES spec for more details.
The object to query.
Returns the array of property names.
Creates an array of the own and inherited enumerable property names of object.
Note: Non-object values are coerced to objects.
The object to query.
An array of property names.
The opposite of _.mapValues; this method creates an object with the same values as object and keys generated by running each own enumerable property of object through iteratee.
The object to iterate over.
The function invoked per iteration.
Returns the new mapped object.
Creates an object with the same keys as object and values generated by running each own enumerable property of object through iteratee. The iteratee function is invoked with three arguments: (value, key, object).
Returns the new mapped object.
Recursively merges own and inherited enumerable properties of source
objects into the destination object, skipping source properties that resolve
to undefined
. Array and plain object properties are merged recursively.
Other objects and value types are overridden by assignment. Source objects
are applied from left to right. Subsequent sources overwrite property
assignments of previous sources.
Note: This method mutates object
.
The destination object.
Returns object
.
This method is like _.merge
except that it accepts customizer
which
is invoked to produce the merged values of the destination and source
properties. If customizer
returns undefined
merging is handled by the
method instead. The customizer
is invoked with seven arguments:
(objValue, srcValue, key, object, source, stack).
The destination object.
The function to customize assigned values.
Returns object
.
The opposite of _.pick
; this method creates an object composed of the
own and inherited enumerable properties of object
that are not omitted.
The source object.
Returns the new object.
The opposite of _.pickBy
; this method creates an object composed of the
own and inherited enumerable properties of object
that predicate
doesn't return truthy for.
The source object.
Returns the new object.
Creates an object composed of the picked object
properties.
The source object.
Returns the new object.
Creates an object composed of the object
properties predicate
returns
truthy for. The predicate is invoked with two arguments: (value, key).
The source object.
Returns the new object.
This method is like _.get except that if the resolved value is a function it’s invoked with the this binding of its parent object and its result is returned.
The object to query.
The path of the property to resolve.
The value returned if the resolved value is undefined.
Returns the resolved value.
Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for missing index properties while objects are created for all other missing properties. Use _.setWith to customize path creation.
The object to modify.
The path of the property to set.
The value to set.
Returns object.
This method is like _.set except that it accepts customizer which is invoked to produce the objects of path. If customizer returns undefined path creation is handled by the method instead. The customizer is invoked with three arguments: (nsValue, key, nsObject).
The object to modify.
The path of the property to set.
The value to set.
The function to customize assigned values.
Returns object.
Creates an array of own enumerable key-value pairs for object.
The object to query.
Returns the new array of key-value pairs.
Creates an array of own and inherited enumerable key-value pairs for object.
The object to query.
Returns the new array of key-value pairs.
An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of running each of its own enumerable properties through iteratee, with each invocation potentially mutating the accumulator object. The iteratee is invoked with four arguments: (accumulator, value, key, object). Iteratee functions may exit iteration early by explicitly returning false.
The object to iterate over.
The function invoked per iteration.
The custom accumulator value.
Returns the accumulated value.
Removes the property at path of object.
Note: This method mutates object.
The object to modify.
The path of the property to unset.
Returns true if the property is deleted, else false.
This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to customize path creation. The updater is invoked with one argument: (value).
The object to modify.
The path of the property to set.
The function to produce the updated value.
Returns object.
This method is like _.update
except that it accepts customizer
which is
invoked to produce the objects of path
. If customizer
returns undefined
path creation is handled by the method instead. The customizer
is invoked
with three arguments: (nsValue, key, nsObject).
Note: This method mutates object
.
The object to modify.
The path of the property to set.
The function to produce the updated value.
Returns object
.
Creates an array of the own enumerable property values of object.
The object to query.
Returns an array of property values.
Creates an array of the own and inherited enumerable property values of object.
The object to query.
Returns the array of property values.
Generated using TypeDoc
Assigns own enumerable properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.
Note: This method mutates
object
and is loosely based onObject.assign
.Object
function Foo() { this.c = 3; }
function Bar() { this.e = 5; }
Foo.prototype.d = 4; Bar.prototype.f = 6;
_.assign({ 'a': 1 }, new Foo, new Bar); // => { 'a': 1, 'c': 3, 'e': 5 }