让我们看一个例子。
var arr1 = new Array({name: "lang", value: "English"},
{name: "age", value: "18"});
var arr2 = new Array({name : "childs", value: '5'},
{name: "lang", value: "German"});
我需要合并这两个数组的对象,并创建以下数组:
var arr3 = new Array({name: "lang", value: "German"},
{name: "age", value: "18"},
{name : "childs", value: '5'});
是否有任何 JavaScript 或 jQuery 函数可以做到这一点?
$.extend
不适合我,它回来了
var arr4 = new Array({name : "childs", value: '5'},
{name: "lang", value: "German"});