Following is some codes and output from the Chrome Developers' Console
Case 1:
var myarr = document.location.hostname.split("."); //typed
undefined //output
myarr[0] //typed
"ptamz" //output: ONE
Case 2:
var name = document.location.hostname.split("."); //typed
undefined //output
name[0] //typed
"p" //output: TWO
Why are the two outputs (commented Output: ONE, and Output: TWO) different?
Screenshot: