直接看代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" >
<html>
<head>
<meta http-equiv= "Content-Type" content= "text/html; charset=GBK" >
<title>Untitled Document</title>
</head>
<body>
<script type= "text/javascript" >
var arr = [23,78,100];
arr[4] = 348;
arr[1] = "abc" ;
arr[2] = true;
for ( var x=0; x<arr.length; x++){
document.write( "arr[" +x+ "]=" +arr[x]+ "<br/>" );
}
</script>
</body>
</html>
|
登录后复制

以上是JavaScript中数组的应用的详细内容。更多信息请关注PHP中文网其他相关文章!