Skip to content

Instantly share code, notes, and snippets.

@korneil
Created March 25, 2012 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korneil/2198707 to your computer and use it in GitHub Desktop.
Save korneil/2198707 to your computer and use it in GitHub Desktop.
recursive iteration
function a(i){
var aLotOfVariable;
iDo.some.asyncStuff(function(){
// here the callstack can grow huge a(0)->a(1)->a(2)->a(3)
// question is how to avoid this.
if(i<1000) a(i+1);
});
}
a(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment