When I write some javascript such as this:
var words = ['word1', 'word2', 'word3']
for (word in words) {
console.log(word)
}
The resulting output is the numeric indices of the respective word. I did some searching on Google and I couldn't find the exact reason for this behavior. I'm guessing that this is completely expected behavior but I would like to know the reason why.
Thanks!