Skip to content

Instantly share code, notes, and snippets.

@mark-ellul
Created March 3, 2011 20:11
Show Gist options
  • Save mark-ellul/853432 to your computer and use it in GitHub Desktop.
Save mark-ellul/853432 to your computer and use it in GitHub Desktop.
Excercise 2
(function(strName, container) {
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
index--;
}
container[strName] = function(){
index = 10;
iterate();
}
})("countdown", this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment