JavaScript break【每日一段代码59】

<html>
<body>
<script type="text/javascript">
for (i=0; i<10; i++)
{
document.write("数字是"+i);
document.write("<br>");
if (i==3)
{
break;
}
}
</script>
<p>解释:循环会在 i=3 时中断。</p>
</body>
</html>

posted on 2012-03-24 16:42  Cosimo  阅读(135)  评论(0编辑  收藏  举报

导航