Answer the question
In order to leave comments, you need to log in
How to fill one object with the properties of another?
There is an initial object: obj1 = {a: 1, b: [], c: 'str'}
It is necessary to fill in all the properties of the second object into it: obj2 = {a: 2, c: 'new str', d: 123}
To get either {a: 2, b: [], c:'new str'}
or {a: 2, b: [], c:'new str', d: 123}
What is the easiest way to do this?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question