I am trying to code this in ES6. Below is what I am trying to achieve. Let\'s say I have an array of objects called schools.
schools
let schools = [ {na
If you want to edit only the commented part:
const editSchoolName = (schools, oldName, name) => schools.map(item => { if (item.name === oldName) { var newItem = Object.assign({},item); newItem.name = name; return newItem; } else{ return item; } });