Skip to content
Advertisement

How do arrange arrays with different combinations?

I have 3 arrays ["s","m"], ["Red","Black"], ["1", "2"]. I want to arrange them like this:

JavaScript

I’m out of idea, please help me.

Advertisement

Answer

Loop each one then just combine them into an array.

Script:

JavaScript

Output:

output

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