var arr1 = [
{name:"张三",age:"16"},
{name:"李四",age:"18"}
]
var arr2 = [
{flag:false},
{flag:true}
]
var list = arr1.map((key,index) => { return {...key,...arr2[index]}})
输出结果
{name:"张三",age:"16",flag:false},
{name:"李四",age:"18",flag:true}
两个数组里的对象一对一进行合并
最新推荐文章于 2024-06-20 17:31:02 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)