This question has already been answered:
Implement the extend(obj1, obj2) function that copies the properties from the obj2 object to the obj1 object. The function must return obj1. Values of identical keys must grind the original. Example:
extend({foo: 'bar', baz: 1}, {foo: true, zoop: 0}); // {foo: true, baz: 1, zoop: 0} I thought to do it through some method, but I did not find it ...
I read and read about the methods, but nowhere did I see how to copy the properties of one into another.