[
{ name: 'Rahul Patel' },
{ name: 'Karan Patel' },
{ name: 'Shubham Tayal' },
{ name: 'rahul patel' },
{ name: 'Prakash shah' }
]
我不是javascript开发人员,但可能是这样的:
employes.forEach(element => element.name = element.name.toUpperCase());
const employes=[{name:'Rahul Patel'},{name:'Karan Patel'},{name:'Shubham Tayal'},{name:'rahul patel'},{name:'Prakash shah'}]
const toUpper = employes.map(o => ({ name: o.name.toUpperCase() }));
console.log(toUpper);