While creating a small counter based game, I had an array like this:
var status = ["day","dusk","night","dawn"];
If I tried to access the first index of the array, I would get:
console.log(status[0]); //yields "d"
@monners mentioned it might be a reserved word, so I changed the variable name to xstatus
and it worked fine.
My question is: why would status[0]
return only the first letter of the first index?