I have a very trivial question. For a simple loop with setTimeout, like this:
for (var count = 0; count < 3; count++) { setTimeout(function() {
That's because all the timeouts are run when the loop finished.
The timeout functions then take the current value of count.
And thats always 3 because the for loop has finished.