Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

map add key to object in array javascript

const newArr = [
  {name: 'eve'},
  {name: 'john'},
  {name: 'jane'}
].map(v => ({...v, isActive: true}))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #map #add #key #object #array #javascript
ADD COMMENT
Topic
Name
2+8 =