This method is like _.assign except that it iterates over own and inherited source properties.
_.assign
Note: This method mutates object.
object
The destination object.
Returns object.
extend
function Foo() { this.b = 2;}function Bar() { this.d = 4;}Foo.prototype.c = 3;Bar.prototype.e = 5;_.assignIn({ 'a': 1 }, new Foo, new Bar);// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } Copy
function Foo() { this.b = 2;}function Bar() { this.d = 4;}Foo.prototype.c = 3;Bar.prototype.e = 5;_.assignIn({ 'a': 1 }, new Foo, new Bar);// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
_.assignIn
This method is like
_.assignexcept that it iterates over own and inherited source properties.Note: This method mutates
object.