【发布时间】:2018-03-26 19:31:53
【问题描述】:
我有我的json,如下所示
[{
"attributeId": 6,
"attributeType": "price",
"attributeValue": "{10,20,100}",
"displayOn": "true",
"attributeName": "price"
},
{
"attributeId": 6,
"attributeType": "price",
"attributeName": "price",
"displayOn": "true",
"attributeValue": "{21,40,200}"
}
]
我想合并成一个不重复的像
[{
"attributeId": 6,
"attributeType": "price",
"attributeValue": "{10,20,100}",
"displayOn": "true",
"attributeName": "price",
"attributeValue": "{21,40,200}"
}]
我尝试了extend 和concat 函数。但是,我无法找出正确的方法来做到这一点。请帮我解决这个问题。
【问题讨论】:
-
JSON 是否总是有一个包含两个“对象”的数组?
-
不..它也会有两个以上