I have created an array and received another from a php file. The data is fine but when i try to copy one array to another, it seems like when i change arr1 then arr2 is also changed.
It is being copied "by reference" and not "by value" as i need
I also tried slice() butit doesn't work, The variable does not being copied at all, not even "by reference" in that way.
// arr1[0] = "Hey";//this array is coming from another file and the data is fine
var arr2 = [];
arr2[0] = arr1[0];
arr2[0] += "1"; // right now arr1 and arr2 both has "Hey1" in them.
Any ideas? Thank You