Skip to content
Advertisement

How to convert a javascript array of Objects from one format to another format?

I have an array of objects and want to convert it from one format to another format.

the initial array looks like:

JavaScript

how to convert it to a format like this?

JavaScript

any help please?

Advertisement

Answer

You can populate an objected keyed off the value categories and add the relevant data.

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