First array:
const arr1 = [[1, 2, 3, 4], [5, 6, 7, 8]];
Second array:
const arr2 = [['some1', 'some2'], ['some3', 'some4']];
Desired array:
const finalArr = [[1, 2, 3, 4], ['some1', 'some2'], ['some3', 'some4']];
So, basically finalArr
should have first index array of arr1
and the rest
of arr2
.
How can this be done?