JS Mapa de Array e Atualizar Valor da Array TAT
const editSchoolName = ((schools, oldName, name) =>{
let results =schools.map((item,index) => {
if (item.name === oldName) {
let newItem = {...item, name}
return newItem;
} else {
return item;
}
});
return results;
});
John wick