数组遍历再赋值最后整合一个新数组对象
数组遍历再赋值最后整合一个新数组对象
<script type="text/javascript" charset="utf-8">
let a = [["张三","14"],["李四","15"],["王五","16"]];
let arr = [];
a.forEach(function(value,key){
console.log(value);
let c= {};
c.name = value[0];
c.id = value[1];
arr.push(c)
原创
2020-08-21 15:59:00 ·
684 阅读 ·
0 评论