json数组数据处理
1.根据数组某一项去重
function uniqueArray(array, key) {
let result = []
array.map((item, index) => {
let repeat = false
result.map((itm, ind)=> {
if(itm[key] === item[key]) {
return repeat = true
}
})
if (!repeat) {
result.push(item)
}
})
return result
}

浙公网安备 33010602011771号