993c2879f4d124bec56654ad10217e51f61f97da5769e4393517896a7c017c81c87e6d6f74f54e9a4436fffd1fd9e479d5084021a45a15ad43b2105e7182e3 360 B

123456789101112131415161718
  1. var Stack=require('../stack');
  2. //create a new Stack instance
  3. var stack=new Stack;
  4. stack.autoRun=false;
  5. for(var i=0; i<50; i++){
  6. //add a bunch of stuff to the stack
  7. stack.add(makeRequest.bind(stack,i));
  8. }
  9. stack.next();
  10. function makeRequest(index){
  11. //do stuff
  12. console.log(`making LIFO request ${index}`);
  13. this.next();
  14. }