So we have an empty JavaScript object, and we want to initialize its keys with the value of another object which has only some of the key-values from the first object, without changing the values of the other keys. Is there any library that can pull this off?
The Empty object : {'name' : 'John' , 'lastName' : ' '}
The second object: {'name' : 'Alex'}
The desired output : {'name':'Alex', 'lastName' : ' '}
Fyi: I know that this can be implemented with a bunch of ifs and for loops, but I wanted to know if there was a library that can do this in a better way.