js 数组对象中属性的合并

246 阅读1分钟

1.数据结构如下

微信图片_20220224094436.png

2.实现思路

let statistics = this.data.statistics.map((item, index) => {return {...item,...arr[index]}});

3.想要的数据结构

微信图片_20220224094701.png