為什么輸出頁面什么都沒有顯示
<!DOCTYPE ?HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>數(shù)組</title>
<script type="text/javascript">
var arr=new Array['*','##',"***","&&","****","##*"];
arr[7]="**";
?//創(chuàng)建數(shù)組
?alert(arr.length);
?//顯示數(shù)組長度
?document.write(arr[0]+"<br>"+arr[7]+"<br>"+arr[2]+"<br>"+arr[4]+"<br>");
?
?//將數(shù)組內(nèi)容輸出,完成達到的效果。
</script>
</head>
<body>
</body>
</html>
2017-03-02
數(shù)組定義錯誤:
var arr=new Array('*','##',"***","&&","****","##*");
new Array后面要加(),如果使用[],則不要加new Array定義;
2017-03-02
Uncaught TypeError: Array[((((("*" , "##") , "***") , "&&") , "****") , "##*")] is not a constructor(…)