Why is the counter variable getting stuck on one value?

Why is the counter variable getting stuck on one value?
0.0 0

#1

I’m trying to loop through an array and print out the names in the array for the Twitch.tv app (have to use the names in the array since the JSON doesn’t provide names for users who are not streaming). Anyway, the counter variable seems to behave in a very wonky way one it gets inside the getJSON function – it gets stuck on 7, so that I can only get the 8th item in the array whenever I call it. Anybody know why this is happening? What do I have to do to get the counter variable to behave when it goes into the new function?


#2

Did you resolve your problem?


#3

Yes – actually I did. It was a hoisting issue. Thanks for asking.