I have multiple JSON like those
var object1 = {name: \"John\"};
var object2 = {location: \"San Jose\"};
They are not nesting o
Here is simple solution, to merge JSON. I did the following.
JSON.stringify(object).+ operator./}{/g with ","Parse the result string back to JSON object
var object1 = {name: "John"};
var object2 = {location: "San Jose"};
var merged_object = JSON.parse((JSON.stringify(object1) + JSON.stringify(object2)).replace(/}{/g,","))
The resulting merged JSON will be
{name: "John", location: "San Jose"}