I have an array say
var list = ["first", "second"];
now I assign list to some other variable say
var temp = list;
Now when I use splice on list like
list.splice(0,1);
Now when I check the value of list it shows
list = ["second"]
Also when I check the value of temp then it says
temp = ["second"]
I want to know why is that so? Why the value of temp is changed?