You can only do this with Object.assign (), which is the internal structure of the language:
let o1 = {a: 1, b: 1, c:1}; let o2 = {b:5}; let o3 = Object.assign({}, o1, o2);
result:
o1: {a: 1, b: 1, c:1}; o2: {b: 5}; o3: {a: 1, b: 5, c:1};
Chechelnitsky Alexander
source share