defaultsDeep source npm
_.defaultsDeep(object, [sources])
This method is like _.defaults
except that it recursively assigns
default properties.
Note: This method mutates object
.
Arguments
- object (Object)
The destination object.
- [sources] (...Object)
The source objects.
Returns (Object)
Returns object
.
Example
_.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
// => { 'user': { 'name': 'barney', 'age': 36 } }