将数组 [{id:"1",name:"AAA"}]
修改为 ===> [{id:"1",text:"AAA",value:"AAA"}]
!
var arr = [{id:1,name:'张三'},{id:2,name:'李四'}]
for(var i in arr){
for(var j in arr[i]){
if(j == 'name'){
arr[i]['text'] = arr[i][j] //修改属性名为“text”
delete arr[i]['name'] //删除“text”
}else if(j=='id'){
arr[i]['value'] = arr[i][j]
}
}
}