Skip to content

Instantly share code, notes, and snippets.

@themartorana
Created January 20, 2011 19:58
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 themartorana/788520 to your computer and use it in GitHub Desktop.
Save themartorana/788520 to your computer and use it in GitHub Desktop.
Dmart
var countdown = (function() {
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
index--;
}
return function(seconds){
index = seconds;
iterate();
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment