How can I merge jquery objects together
I have
{
\"merchantcontract\":\"Ready Reserve Foods 10104.01\",
\"merchantcontractid\":\"c4253769-5a57-e11
In case you wish to merge them recursively, $.extend offers the argument deep
. In case deep=true
the merge become recursively. An example above,
// Initialize two objects.
var json1 = { "a": { "a1": "value1", "a2": "value2" }};
var json2 = { "a": { "a3": "value3" }};
// Merge them recursively.
var newJson = $.extend(true, {}, json1, json2);
// Test it.
if (newJson.a.a1 && newJson.a.a3) {
console.log("Success");
}