问题描述
let arr1 = [
{abc:"name"},
{abc:"content"}
]
let arr2 = [
{0:"111",1:"222"},
{0:"333",1:"444"}
]
你期待的结果是什么?
let arr3 = [
{name:"111",content:"222"},
{name:"333",content:"444"}
]
let arr1 = [
{abc:"name"},
{abc:"content"}
]
let arr2 = [
{0:"111",1:"222"},
{0:"333",1:"444"}
]
let arr3 = [
{name:"111",content:"222"},
{name:"333",content:"444"}
]
const arr3 = arr2.map(i=>{
const obj = {}
for(var j in i){
obj[arr1[j].abc]=i[j]
}
return obj
})
8 回答4.6k 阅读✓ 已解决
6 回答3.3k 阅读✓ 已解决
5 回答2.8k 阅读✓ 已解决
5 回答6.3k 阅读✓ 已解决
4 回答2.2k 阅读✓ 已解决
4 回答2.7k 阅读✓ 已解决
3 回答2.4k 阅读✓ 已解决
let arr3 = []
arr2.map((item,index) => {
})