I'm sure this is a stupid thing, but i can't solve it.
If i do this:
var arr = [1, 2, 3, "up"];
var duplicate = arr;
duplicate[3] = "down";
console.log(arr[3]); //"down"
console.log(duplicate[3]); //"down"
So why the original array got modified too? It is related to the fact that they point to the same array?
How to modify only the duplicate?