A simple way to merge JSON objects is to use dojo.mixin():
var jsonObj = {foo:"bar"}; var jsonObjNew = {bar:"foo"}; console.debug(dojo.toJson(dojo.mixin(jsonObj, jsonObjNew)));
The above code will result in {foo:”bar”, bar:”foo”}.
A simple way to merge JSON objects is to use dojo.mixin():
var jsonObj = {foo:"bar"}; var jsonObjNew = {bar:"foo"}; console.debug(dojo.toJson(dojo.mixin(jsonObj, jsonObjNew)));
The above code will result in {foo:”bar”, bar:”foo”}.
Leave a Reply