Possible Duplicate:
Adding two json objects and sorting
Iam having two json objects
[
{"name": "Graduation"},
{"name": "Post Graduation"}
]
and another one is also same
[
{"name": "first sem"},
{"name": "second sem"},
{"name": "third sem"}
]
how can i add two json objects into one,like
[
{"name": "Graduation"},
{"name": "Post Graduation"},
{"name": "first sem"},
{"name": "second sem"},
{"name": "third sem"}
]
I tried
_this.model = new qualification();
_this.model1 = new sems();
jsondata = _this.model.toJSON();
jsonData = _.extend(_this.model1.toJSON(),jsonData)
getting json by overriding keys
even I tried
var result = _.union([jsonData1],[jsonData2]);
console.log(JSON.stringify(result));
and with concat also it prints output as
[{"0":{"name":"first sem"},"1":{"name":"second sem"},"2":{"name":"third sem"}},{"0":{"name":"Graduation"},"1":{"name":"Post Graduation"}}],