JS Source:
var c1 = [\"Saab\", \"Volvo\", \"BMW\"]; var c2=c1; c1.sort(); document.getElementById(\"demo\").innerHTML = \'1 -> \'+c1+\'2 -> \'+c2
Just use slice(0):
var c1 = ["Saab", "Volvo", "BMW"]; var c2=c1.slice(0); c1.sort(); alert(c1); alert(c2);
Here a sample:
http://jsfiddle.net/c3161930/
Best regards, Felipe