const editSchoolName = (schools, oldName, newName) => schools.map(({name, ...school }) => ({ ...school, name: oldName === name ? newName : name }));