_.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
object
(Object): The destination object.[sources]
(…Object): The source objects.
Returns
(Object): Returns object
.
Example
_.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });// => { 'a': { 'b': 2, 'c': 3 } }
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .