Stackexample

来源:互联网 发布:送货统计软件 编辑:程序博客网 时间:2024/06/05 05:24

<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>

原创粉丝点击