Skip to content

Instantly share code, notes, and snippets.

@kennystone
Created December 12, 2011 19:52
Show Gist options
  • Save kennystone/1468804 to your computer and use it in GitHub Desktop.
Save kennystone/1468804 to your computer and use it in GitHub Desktop.
var countdown = (function() {
var log = function(index) {
console.log(index);
},
iterate = function(index) {
log(index);
if(index>1) setTimeout(function() { iterate(index); }, 1000);
index--;
};
return function() { iterate(10) };
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment