Skip to content
Advertisement

How to merge same type of array of object value in javascript

I am getting this data from API and I want to change the same type of array of object in it in this form as given below Anwser.

JavaScript

It stores multiple values in a single variable. The object can contain like a catid, catimage, etc. Actually, I hold the same object of the data in the single objects define in the description. So, help me everyone can solve this problem. please solve this problem.

JavaScript

Advertisement

Answer

This iteration will group each thing to group (using reduce or whatever – as long as it’s a loop) then extract values from it as array.

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