0

I have an object as,

const a = {
   "val1": 1,
   "val2": 2
}

And I want to map through it as,

const entries = Object.entries(a);

const mappedA = entries.map(entry => {type: entry[0], value: entry[1]})

How can I achieve this? This keeps throwing an error

Mike K
  • 7,621
  • 14
  • 60
  • 120

0 Answers0