首页 > 代码库 > json 合并

json 合并

 var o1 = {a:1,b:3,c:3},o2 = {b:5,c:4,d:6};
              a = eval("("+(JSON.stringify(o1)+JSON.stringify(o2)).replace(/}{/,",")+")");
            console.log(a)

 结果为:Object {a: 1, b: 5, c: 4, d: 6}

json 合并