Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myfunc = (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;
- })(this)
Add Comment
Please, Sign In to add comment