+ 1

Creating a new array.

Let say I have 3 arrays as follows: var arr1=[1,2,4,6,0]; var arr2=[3,9,5,7,1]; var arr3=[1,2,7,4,8,6]; How do I create a new array that will be like var arr5=[0,1,2,3,4,5,6,7,8,9] ? If I concat the three arrays I won't have that. If I filter , my output won't be that . If I slice , still not it. I'm thinking the only solution is to manipulate the data and doing it after 3 or 4 code lines. Using JavaScript. Is There A Faster Way ?🤔

14th Sep 2020, 6:29 PM
Timmy Afolami
Timmy Afolami - avatar
2 Antworten
14th Sep 2020, 6:41 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
TheWh¡teCat 🇧🇬 Thanks a lot. The method there seems new to me.
14th Sep 2020, 6:46 PM
Timmy Afolami
Timmy Afolami - avatar