In one of my projects, I had to copy values of one array to another.
When i tried doing it this way :
var Arr1 = new Array(1,2,3,4,5,6,7,8,9,10);
var Arr2 = Arr1; // will this create a pointer ??
Is it creating a pointer ?
Fiddle : I mean after the loop,if i try to access Arr1, it returns empty.
for(var i=0;i<Counter;i++)
{
$('#testDiv').append(Arr2.pop() + " ");
}
alert("The element in other array : " + Arr1);
Is there anything like pointer in javascript ?