这样写那些错了?为什么不输出呢?
这样写那些错了?为什么不输出呢?
var myarr=["*","##","***","&&","****","##","**"];
for(j=0;j<3;j+2)
{
document.write(myarr[j]+"</br>");
document.write(myarr[7-j]+"</br>");
}
这样写那些错了?为什么不输出呢?
var myarr=["*","##","***","&&","****","##","**"];
for(j=0;j<3;j+2)
{
document.write(myarr[j]+"</br>");
document.write(myarr[7-j]+"</br>");
}
2016-05-11
<script type = "text/Javascript">
//定义数组
var arr = new Array();
var arr = ['*', '##', "***", "&&", "****", "##*"];
arr[7] = "**";
//弹出窗口,显示数组长度
alert("数组长度是:"+arr.length);
document.write(arr + "<br><br>");
//定义循环依次读取位置0,2,4的值
for (var i=0;i<5;i=i+2)
{
document.write(arr[i] + "<br><br>");
if (i == 0)//在开始时只读取一次位置7上的值
{
document.write(arr[arr.length-1] + "<br><br>");
}
}
</script>
举报