js map重构对象数组太好用啦大家快来用呀
let a = [1,2]
//如果想变为[name=1,name=2]
let b=[]
b=a.map(item=>{
return name = item
})
console.log(b) // [name=1,name=2]
let a = [1,2]
//如果想变为[name=1,name=2]
let b=[]
b=a.map(item=>{
return name = item
})
console.log(b) // [name=1,name=2]
共有 0 条评论