JSFiddle - React, Tailwind, and code Playground
JavaScript
var testjson1 = {
"Testvals":
[{"test1key": null, "test2key": 10, "test3key": "Test3val", "test4key": "Test4val", "test5key": [0, 1]}
],
"test": {"test1key": true, "test2key": 1.5, "test3key": "Test1"}, "test4key": "Test2", "test5key": "Test3", "test6key": "Test4"
}
var testjson2 = {"test": {"test1key": true, "test2key": 1.5, "test3key": "test3val"}, "test4key": "test4val", "test5key": "test5val", "test6key": "test6val"}
var finaljsonresult = $.extend(testjson1, testjson2);
console.log(JSON.stringify(finaljsonresult));//giving [object Object]
//alert(JSON.stringify(testjson1.concat(testjson2)));//if i try this, it is giving error like: VM96:56 Uncaught TypeError: testjson1.concat is not a function on my console.
//but I need to combine/merge those two json objects so that I can get only one final json object like: {"Testvals": [{"test1key": null, "test2key": 10, "test3key": "Test3val", "test4key": "Test4val", "test5key": [0, 1]}],"test": {"test1key": true, "test2key": 1.5, "test3key": "Test1"}, "test4key": "Test2", "test5key": "Test3", "test6key": "Test4"}