function myFunction() {
var a = {};
a.myArray = ["Saab", "Volvo", "BMW"];
var b=a.myArray;
b.push("Chevy");
alert(a.myArray);}
In this above function I have created an object "a" and created an array "myArray". Now I am copying that array in "b" and modifying array "b".But why is it changing a.myArray and how to avoid this?