Skip to content
Advertisement

How to transform an object into an array of objects?

I am looking for a way to transform an object into an array of objects, and remove the first unique key.

How can I make this:

JavaScript

into this:

JavaScript

so I can .map through it like this:

JavaScript

Advertisement

Answer

You can use Object.keys() to get array of keys and then map() to change keys to values or in this case objects.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement