I'm trying to use a for loop to modify an array then store that modification in another array than do another modification and store that to the second array etc, but my second array is just d instances of the last iteration of my for loop. This seems like a closure problem but I can't figure out a workaround?
for (var d=1; d<arr1.length; d++) {
remove = arr1.splice(d,1).toString();
arr1.splice(d+1,0,remove);
arr2.push(arr1);
}
return arr2;