I have an array:
["1", "2","3","4","5"]
that I would like to change to:
[["1, 0 ,0 ,0"], ["2, 0, 0, 0"],["3,0,0,0"],["4,0,0,0"],["5,0,0,0"]]
I've tried to achieve this with the following code:
var arr1 = ["1", "2","3","4","5"];
var arr2 = [,"0", "0","0"];
for(var z=0; z<arr1.length; z++)
{
arr1[z] = arr1[z].concat(arr2);
console.log(arr1)
}
However, this doesn't achieve what I want and places commas between each item, which I think is because it is not a string? I've tried using .join too but I couldn't get that to work either. Could someone point me in the right direction for this please? Thanks.