用for写循环为什么不行?
<script type="text/javascript">
var mynum =new Array(70,80,66,90,50,100,89);//定义数组mynum并赋值
/*var i=0;
while(i<mynum.length){
if (mynum[i]<60){
document.write("成绩"+mynum[i]+"不及格,不用循环了"+"<br>");
break;
}
document.write("成绩"+mynum[i]+"及格,继续循环"+"<br>");
i=i+1;
}*/
var i;
for(i=0,i<mynum.length,i++){
if(mynum[i]<60){
document.write("成绩"+mynum[i]+"不及格,不用循环了"+"<br>");
break;
}
document.write("成绩:"+mynum[i]+"及格,继续循环"+"<br>");
}
</script>