When creating a game with a small counter, 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 that it could be a reserved word, so I changed the variable name to xstatus and it worked fine.
My question is: why status[0] return only the first letter of the first index?
javascript arrays
Sterling archer
source share