I have an array [a, b, c]. I want to be able to insert a value between each elements of this array like that: [0, a, 0, b, 0, c, 0].
[a, b, c]
[0, a, 0, b, 0, c, 0]
I gues
all of the above methods in very long strings made my android computer run on React Native go out of memory. I got it to work with this
let arr = ['a', 'b', 'c']; let tmpArr = []; for (const item in arr) { tmpArr.push(item); tmpArr.push(0); } console.log(tmpArr);