实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <title>Array Type Example 10</title>
5
    <script type="text/javascript">
6
        var colors = ["red", "blue"];
7
        colors.push("brown");              //add another item
8
        colors[3] = "black";               //add an item
9
        alert(colors.length);  //4
10
        
11
        var item = colors.pop();           //get the last item
12
        alert(item);  //"black"
13
14
    </script>
15
</head>
16
<body>
17
18
</body>
19
</html>