I fetch some fancy data from an MVC Controller and asign it to the global variable "data_Visits". Then, later in the party, I need to operate repeatedly on the original data in "data_Visits".
To not change values in "data_Visits", I thought to clone it and then operate on the clone. Still, the following seems to change values in "data_Visits":
var data = data_Visits.slice(0);
data.forEach(function (d) {
d.date = new Date(ToJavaScriptDate(d.date));
d.result1 = +d.result1;
d.result2 = +d.result2;
});
Would anybody happen to know WHY?