栈方法2

2017-06-15 18:44:00
admin
原创
459
<!DOCTYPE html>
<html>
<head>
    <title>Array Type Example 10</title>
    <script type="text/javascript">
        var colors = ["red", "blue"];
        colors.push("brown");              //add another item
        colors[3] = "black";               //add an item
        alert(colors.length);  //4
        
        var item = colors.pop();           //get the last item
        alert(item);  //"black"

    </script>
</head>
<body>

</body>
</html>
  • QQ讨论群
  • 关注微信
    • 欢迎咨询
    • 欢迎加入QQ群 16506021
  • 公众号:源宝网络