Answers for "add key to array and make it array of objects javascript"

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 key to array and make it array of objects javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language