数组
代码案例如下:
<html>
<head>
<meta charset="UTF-8">
<title></title>![这里写图片描述](https://img-blog.csdn.net/20170928074943254?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYWJjMTUxNTY3MTQ5NzY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
<script>
// int[] arry = new int[5];
//方法一、
var arry = new Array(5);
// int[] arry = {1,2,3,4,5};
//方法二、
var arry2 = [1,3.14,"hello",true];
// int[] arry = new int[]{1,2,3,4};
//方法三、
var arry3 = new Array(1,3.14,"hello",true);
// alert(arry2.length);
//遍历
for (var i = 0; i<arry2.length; i++) {
document.write(arry2[i]+"<br>");
}
</script>
</head>
<body>
</body>
</html>