Skip to content

Instantly share code, notes, and snippets.

@akumpf
Created January 11, 2013 22:08
Show Gist options
  • Save akumpf/4514374 to your computer and use it in GitHub Desktop.
Save akumpf/4514374 to your computer and use it in GitHub Desktop.
(function(){
var i = 0;
function forloop1(){
if(i<10){
(function(){
var j = 0;
function forloop2(){
if(j<10){
console.log(i,j);
j++;
setTimeout(forloop2, 0);
}else{
i++;
setTimeout(forloop1, 0);
}
}
forloop2();
})();
}else{
console.log("all done");
}
}
forloop1(0);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment