以下两个JSON需要合并[ { "playerName": "小张", "updatedAt": "2017-03-28 10:03:57" }][ { "playerName": "小王", "updatedAt": "2017-03-28 10:03:57", }]需要把下面的JSON拼接成一个:[{"createdAt":"2017-03-25 13:38:55"playerName":"测试帐号"}][{"createdAt":"2017-03-28 10:03:57"playerName":"小王"}]希望的结果为:[{"createdAt":"2017-03-25 13:38:55"playerName":"测试帐号"},{"createdAt":"2017-03-2810:03:57"playerName":"小王"}]我用的代码为:dataC = eval('('+(JSON.stringify(dataI.results)+JSON.stringify(dataB.results)).replace('\[\]',',')+')');请问如何能将把JSON中段的 [] 替换成 ,
添加回答
举报
0/150
提交
取消
