var obj ={ apple: 1, banana:2, li:30};var arr = [ {id:'1',text:'苹果',key:'apple', value:''}, {id:'2',text:'梨', key:'li',value:''}, {id:'3',text:'香蕉', key:'banana', value:''} ];// 结果:生成一个新的数组var newArr = [ {id:'1',text:'苹果',key:'apple', value:'1'}, {id:'2',text:'梨', key:'li',value:'2'}, {id:'3',text:'香蕉', key:'banana', value:'30'} ];
慕沐林林
ibeautiful
相关分类