var array =[
{name:'lili',age:18},{name:'meimei',age:19}
]
let nameList = array.map(x=>{return x.name})
console.log(nameList)//['lili','meimei']
var array =[
{name:'lili',age:18},{name:'meimei',age:19}
]
let nameList = array.map(x=>{return x.name})
console.log(nameList)//['lili','meimei']
本文标题:将对象数组中每一项的某个元素生成一个新的数组
本文链接:https://www.haomeiwen.com/subject/lmtxqltx.html
网友评论