I’ve been trying to get a specific result to this issue but couldn’t find an answer that suits it, so I’m working with 2 arrays of the same length:
arr1 = [value1,value2,value3]
arr2=[otherValue1,otherValue2,otherValue3]
how can I concat the 2 arrays by the order of the index?
expected result = [value1,otherValue1,value2,otherValue2,value3,otherValue3]
Sorry if this question is a duplicate, but couldn’t find my expected result by using concat or splice.
3
Answers
You can use
reduce