Skip to content
Advertisement

Mapping in map in json response

I need to parse json api response, with response.data equals:

JavaScript

and I need to return one array[String] with all subcategories, ex [“web-development”, “backend-development” … “3D modeling”]

All that I did is:

JavaScript

and it returns Array of arrays with categories. Im sure, that there near a better and easier way. Thanks!

Advertisement

Answer

JavaScript

Try using Array flatMap

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