var items = new Array("one", "two", "three");
var itemsRef = items;
items.push("four");
console.debug(itemRef);
console.debug(items);
I really dont get the idea how above items and itemsRef are same even items added "four" when after itemsRef referenced items. Isn't it reasonable that itemsRef should have only ("one" "two" "three")?
If itemsRef keep pointing items forever, why do we use such an useless argument like items = itemsRef? I am still not getting the idea. Can anybody tell me how this is works and why JavaScript let variables pointing each other forever?