js如何把下列数据处理成目标想要的数据 ?-灵析社区

光光哥乌昂

reduce功能很强大,可以学习下 result.reduce((arr, item) => arr.concat(item.secondName.map((sitem, sindex) => ({name: item.name, secondName: sitem, index: arr.length + sindex}))), [])

阅读量:1

点赞量:0

问AI