Skip to content

Instantly share code, notes, and snippets.

@bgkittrell
Created October 19, 2010 18:27
Show Gist options
  • Save bgkittrell/634747 to your computer and use it in GitHub Desktop.
Save bgkittrell/634747 to your computer and use it in GitHub Desktop.
<script>
(function(cont, meth) {
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
index--;
}
cont[meth] = function (){
index = 10;
iterate();
}
})(this, 'countdown');
countdown();
</script>
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment