Answers for "add key value using map javascript"

8

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
1

js add to Map

// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set
const map = new Map();
map.set("key", "value");
Posted by: Guest on April-15-2022

Code answers related to "add key value using map javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language