_.assignIn(object, [sources])
This method is like _.assign
except that it iterates over own and inherited source properties.Note: This method mutates object
.
Since
4.0.0
Aliases
_.extend
Arguments
object
(Object): The destination object.[sources]
(…Object): The source objects.
Returns
(Object): Returns object
.
Example
function Foo() {this.a = 1;}function Bar() {this.c = 3;}Foo.prototype.b = 2;Bar.prototype.d = 4;_.assignIn({ 'a': 0 }, new Foo, new Bar);// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .