Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var countdown = function() {
- var index;
- function log() {
- console.log(index);
- }
- function iterate() {
- // gah getting an undefined ??
- log();
- if(index > 1) setTimeout(iterate, 1000);
- index--;
- }
- return function() {
- index = 10;
- iterate();
- }()
- };
- countdown();
Add Comment
Please, Sign In to add comment