I have multiple JSON like those
JSON
var object1 = {name: \"John\"}; var object2 = {location: \"San Jose\"};
They are not nesting o
You can do it inline, without changing any variables like this:
let obj1 = { name: 'John' }; let obj2 = { surname: 'Smith' }; let obj = Object.assign({}, obj1, obj2); // { name: 'John', surname: 'Smith' }