Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js array map and update tat array value

const editSchoolName = (schools, oldName, name) =>
  schools.map(item => {
      if (item.name === oldName) {
        return {...item, name};
      } else {
        return item;
      }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #array #map #update #tat #array
ADD COMMENT
Topic
Name
6+2 =