While loop test : While « Language Basics « JavaScript DHTML
- JavaScript DHTML
- Language Basics
- While
While loop test
<html>
<script language="JavaScript">
<!--
function loopTest() {
var index = 1;
while (index <= 12) {
if (index == 6)
break;
index++;
}
document.write("The break statement brings us here.");
}
loopTest();
//-->
</script>
</html>
Related examples in the same category