SO Help: jQuery Merge Array Objects
by SpYk3
HTML
<center>See Console Log</center>
CSS
center { padding: 3em; }
JavaScript
;(function($) { if (!$.concat) $.extend({ concat: function() { return arguments.length ? Array.prototype.concat.apply([], arguments) : []; } }); })(jQuery);
$(function() {
var json1 = [{id:1, name: 'xxx'}],
json2 = [{id:2, name: 'xyz'}],
json3 = [{id:3, name: 'xyy'}],
json4 = [{id:4, name: 'xzy'}],
json5 = [{id:5, name: 'zxy'}];
console.log($.concat(json1, json2, json3))
console.log($.concat(json1, json2, json3, json4, json5))
console.log($.concat(json4, json1, json2, json5))
});