name is short for window.name , which is a property that contains the name of the current window. Following:
var name = ["Hello", "foo", "test", "tried"];
does not create a new variable. Instead, the array is smoothed into a string, and the result is assigned to the name property:
> var name = ["Hello", "foo", "test", "tried"]; undefined > name "Hello,foo,test,tried"
This causes weird iteration behavior.
source share