Skip to content

Instantly share code, notes, and snippets.

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