Skip to content

Instantly share code, notes, and snippets.

@bradpauly
Created March 7, 2013 20:05
Show Gist options
  • Save bradpauly/5111314 to your computer and use it in GitHub Desktop.
Save bradpauly/5111314 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 countdown(){
index = 10;
iterate();
}
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment