js修改对象的key值
<script> var array = [ { count:1, itemName:"007" }, { count:2, itemName:"008" } ] var result = array.map(item => { return { value: item.count, name:item.itemName } } ) console.log(result) </script>
<script> var array = [ { count:1, itemName:"007" }, { count:2, itemName:"008" } ] var result = array.map(item => { return { value: item.count, name:item.itemName } } ) console.log(result) </script>