Created
January 11, 2013 22:10
-
-
Save akumpf/4514386 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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