When duplicating an array and using sort(), why do both arrays get sorted?
For example:
c = [2,4,9,1,10];
b = c;
b.sort();
console.log(b+" "+c)
I was expecting the array (c) to remain as [2,4, 9, 1, 10] instead it returns the same as b using sort() with both returning [1, 10, 2, 4, 9]