I'm confused with the solution to this task. I have two arrays:
const arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8];
const arr2 = ['a', 'b', 'c', 'd'];
What do I want to get after merging these arrays:
[1, 'a', 'b', 2, 3, 'c', 'd', 4, 5, 6, 7, 8];
Graphically it looks like a snake
It has to work also in the case when the length of the first array is shorter than the second one. For example, I have two arrays:
const arr1 = [ 1, 2, 3, 4];
const arr2 = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
And I want to get after merging:
[1, 'a', 'b', 2, 3, 'c', 'd', 4, 'e', 'f', 'g'];