实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <title>Array Type Example</title>
5
    <script type="text/javascript">
6
        
7
        var colors = new Array(3);      //create an array with three items
8
        var names = new Array("Greg");  //create an array with one item, the string "Greg"
9
10
        alert(colors.length);
11
        alert(names.length);
12
13
    </script>
14
</head>
15
<body>
16
17
</body>
18
</html>