Answers for "add new key in array objects using map"

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 "add new key in array objects using map"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language