队列方法2

2017-06-15 18:46:00
admin
原创
480
<!DOCTYPE html>
<html>
<head>
    <title>Array Type Example 12</title>
    <script type="text/javascript">
        var colors = new Array();                      //create an array
        var count = colors.unshift("red", "green");    //push two items
        alert(count);  //2
        
        count = colors.unshift("black");               //push another item on
        alert(count);  //3
        
        var item = colors.pop();                     //get the first item
        alert(item);   //"green"
        alert(colors.length);  //2



    </script>
</head>
<body>

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