Skip to content

Instantly share code, notes, and snippets.

@daffydowden
Created September 15, 2011 18:59
Show Gist options
  • Save daffydowden/1220141 to your computer and use it in GitHub Desktop.
Save daffydowden/1220141 to your computer and use it in GitHub Desktop.
JS Masterclass - exercise 2
(function(scope){
// Code
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
index--;
}
function countdown(){
index = 10;
iterate();
}
this.countdown = countdown();
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment