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