Skip to content
Advertisement

how to convert one multArray to one simpleArray javascript

I have this situation in my application, one array with multiple arrays inside:

multArray

i need to convert this:

JavaScript

to one single array like:

JavaScript

It’s a react web application, so it need to be in javascript solution.

Advertisement

Answer

Use Array.flatMap:

JavaScript

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