Skip to content

Instantly share code, notes, and snippets.

@brookr
Created March 8, 2012 20:29
Show Gist options
  • Select an option

  • Save brookr/2003253 to your computer and use it in GitHub Desktop.

Select an option

Save brookr/2003253 to your computer and use it in GitHub Desktop.
var countdown = function() {
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
index--;
}
return function(){
index = 10;
iterate();
}();
}
countdown();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment