感覺沒有問題啊,為什么沒有任何顯示?
<script type="text/javascript">
?//創(chuàng)建數(shù)組
?var arr=['*','##',"***","&&","****","##]
?//顯示數(shù)組長(zhǎng)度
?arr[7]="**";
?document.write(arr[0]);
? document.write(arr[2]);
? ?document.write(arr[7]);
? ? document.write(arr[4]);
?alert(arr.length);
?//將數(shù)組內(nèi)容輸出,完成達(dá)到的效果。
</script>
2016-12-31
因?yàn)槟銊?chuàng)建數(shù)組的時(shí)候,最后一個(gè)##缺少一個(gè)雙引號(hào)。即第三行代碼,正確是"##",你少了第二個(gè)雙引號(hào)
2017-01-01
<script?type="text/javascript"> ?//創(chuàng)建數(shù)組 ??var?arr=['*','##',"***","&&","****","##*"]; ?//顯示數(shù)組長(zhǎng)度 ?? ??arr[7]="**"; ??alert(arr.length); ?//將數(shù)組內(nèi)容輸出,完成達(dá)到的效果。 ???document.write(arr[0]); ????document.write("<br?/>"+arr[7]); ????document.write("<br?/>"+arr[2]); ????document.write("<br?/>"+arr[4]); </script>2017-01-01
<script type="text/javascript">
?//創(chuàng)建數(shù)組
? var arr=['*','##',"***","&&","****","##*"];
?//顯示數(shù)組長(zhǎng)度
?
? arr[7]="**";
? alert(arr.length);
?//將數(shù)組內(nèi)容輸出,完成達(dá)到的效果。
?? document.write(arr[0]);
??? document.write("<br />"+arr[7]);
??? document.write("<br />"+arr[2]);
??? document.write("<br />"+arr[4]);
</script>