Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // continuations! lulz
- function dostuff(param, cont)
- {cont=cont||1;function pause(msec){setTimeout(function(){dostuff(param,cont+1);},msec);}switch(cont){
- case 1:
- // first part of function goes here
- alert(param.name+" is a lame-o.");
- return pause(1000);
- case 2:
- // second part of function goes here
- alert("Balls about "+param.name+" continues.");
- return pause(1000);
- case 3:
- // third part of function goes here
- alert("More crap about "+param.name+".");
- }}
- dostuff({name: 'Lamer'});
Add Comment
Please, Sign In to add comment