I'm trying to keep a record array of a certain variable, but whenever I push that variable it doesn't push an instance of that variable, but the variable itself.
var array = [0,0,0];
var record = [];
record.push(array);
for(var i=0;i<array.length;i++) {
array[i]++;
}
record.push(array);
console.log(record);
//I need record to be [[0,0,0],[1,1,1]], but it gives two copies of the latter