Use Array as a stack : Stack « Array « JavaScript Tutorial






<html>
<head>
<title>Example</title>
</head>
<body>
<script type="text/javascript">
var stack = new Array;
stack.push("A");
stack.push("B");
stack.push("C");
document.write("stack:"+stack.toString());

document.write("<br>");

var vItem = stack.pop();
document.write("vItem:"+vItem);
document.write("<br>");
document.write("stack:"+stack.toString());

</script>

</body>
</html>








11.31.Stack
11.31.1.Use Array as a stack
11.31.2.Push form value to a stack