let arr = [{name: 'zhu'}, {name: 'alvin'}]; let arr2 = arr.map(item => { if(item.name === 'zhu') { item.src = 'me' } return item; }) console.log(arr2);