Skip to content

Instantly share code, notes, and snippets.

@michaelBenin
Created May 24, 2012 19:25
Show Gist options
  • Save michaelBenin/2783701 to your computer and use it in GitHub Desktop.
Save michaelBenin/2783701 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script>
console.log("test");
var countdown = (function(){
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
index--;
}
function countdown(){
index = 10;
iterate();
}
return countdown;
})();
countdown();
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment