<script type="text/javascript"> var myarr=new Array(); //定义数组 myarr[0]=80; myarr[1]=60; myarr[2]=99; document.write("第一个人的成绩是:"+myarr[0]); document.write("第二个人的成绩是:"+myarr[1]); document.write("第三个人的成绩是:"+myarr[2]); </script>
数组myarr[0]后面怎么加换行符?
怎么加新的内容?
How to add content after the array? -PHP Chinese website Q&A-How to add content after the array? -PHP Chinese website Q&A
Please watch and learn.
既然你已经知道了,那我就告诉你定义数组的另一种方法吧,更简洁一点, var myarr = [80,60,99];如果是二维数组: var myarr = [[80,60,99],[52,66,88]];