Answers for "map add key to object in array javascript"

6

map add key to object in array javascript

const newArr = [
  {name: 'eve'},
  {name: 'john'},
  {name: 'jane'}
].map(v => ({...v, isActive: true}))
Posted by: Guest on April-09-2020
0

add new key in array objects using map

const newArr = [
  {name: 'eve'},
  {name: 'john'},
  {name: 'jane'}
].map(v => ({...v, isActive: true}))
Posted by: Guest on August-10-2021

Code answers related to "map add key to object in array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language