This method is like assign except that it iterates over own and inherited source properties.
assign
Note: This method mutates object.
object
5.5.0
extend
[[assign]]
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 } Copy
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 }
The destination object.
Rest
Returns object.
This method is like
assign
except that it iterates over own and inherited source properties.Note: This method mutates
object
.Since
5.5.0
Alias
extend
See
[[assign]]
Example