let ary=[ {label: "张三", value: "001"}, {label: "李四", value: "002"}, ]
我想改成
let ary=[ {id: 1,label: "张三"}, {id: 2,label: "李四"}, ]
这样一个循环就可以处理了
ary.forEach(function (item) { item.id = Number(item.value) delete item.value })