Mapa tablicy JS i aktualizacja wartości tablicy 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