Skip to content

Instantly share code, notes, and snippets.

@akumpf
Created January 11, 2013 21:53
Show Gist options
  • Save akumpf/4514262 to your computer and use it in GitHub Desktop.
Save akumpf/4514262 to your computer and use it in GitHub Desktop.
(function(){
// inner scope.. you can't touch me from outside!
var i = 0;
function forloop(){
if(i<10){
console.log(i);
i++;
setTimeout(forloop, 0);
}
}
// call the loop to get things started..
forloop();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment