arr = [ { code:'1', name:'张三', age:'18' }, { code:'2', name:'李四', age:'19' }, { code:'3', name:'王五', age:'20' } ] // const newArray = Array.from(arr,({name}) => name) // let str = [] // arr.forEach(item => { // str.push(item.name) // }) // console.log(str.join('、')) let newArray = [] arr.forEach(item => { if(item.name === '张三') newArray.push('001') if(item.name === '李四') newArray.push('002') if(item.name === '王五') newArray.push('003') }) console.log(newArray.join('、'))