topical media & game development

talk show tell print

professional-javascript-03-StackExample.htm / htm



  <html>
  <head>
  <title>Example</title>
  </head>
  <body>
  <script type="text/javascript">
  var stack = new Array;
  stack.push("red");
  stack.push("green");
  stack.push("yellow");
  alert(stack.toString());     //outputs "red,green,yellow"
  var vItem = stack.pop();
  alert(vItem);                 //outputs "yellow"
  alert(stack.toString());     //outputs "red,green"
  
  </script>
   
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.