為啥不顯示?
<!DOCTYPE? HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>數(shù)組</title>
<script type="text/javascript">
?//創(chuàng)建數(shù)組
?var arr=new Array()=['*','##',"***","&&","****","##*"];
?arr[7]="**";
?//顯示數(shù)組長度
?alert(arr.length);
?
?//將數(shù)組內(nèi)容輸出,完成達(dá)到的效果。
document.write(arr[0]+"<br>");
document.write(arr[7]+"<br>");
document.write(arr[2]+"<br>");
document.write(arr[4]+"<br>");
</script>
</head>
<body>
</body>
</html>
2022-11-01
創(chuàng)建數(shù)組那行
var myarray = new Array(66,80,90,77,59);//創(chuàng)建數(shù)組同時(shí)賦值
var myarray = [66,80,90,77,59];//直接輸入一個(gè)數(shù)組(稱 “字面量數(shù)組”)
不能連等