Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to update the object value of any array key based on value

const newProjects = projects.map(p =>
  p.value === 'jquery-ui'
    ? { ...p, desc: 'new description' }
    : p
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #update #object #array #key #based
ADD COMMENT
Topic
Name
3+4 =