I have 2 Javascript arrays:
['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
['a', 'b', 'c']
I need to insert elements of second array into the first array every 4th or nth index of the first array, resulting in:
['a', '1', '2', '3', '4', 'b', '5', '6', '7', '8', 'c', '9', '10', '11', '12']
n needs to be a parameter, so I can move n to the 5th location, or 3rd location when needed.
Any solutions appreciated. ES6 ones would be great! Thank you in advance.