_.defaultsDeep

_.defaultsDeep(object, [sources])

This method is like _.defaults except that it recursively assigns default properties.

Note: This method mutates object.

Since

3.10.0

Arguments

  1. object (Object): The destination object.
  2. [sources] (...Object): The source objects.

Returns

(Object): Returns object.

Example

_.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
// => { 'a': { 'b': 2, 'c': 3 } }
doc_Lodash
2016-11-27 16:36:13
Comments
Leave a Comment

Please login to continue.