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
  • 5,940
  • 7
  • 37
  • 87

0 Answers0