Check the loop counter for while loop : while « Statement « JavaScript Tutorial






<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">

var i = 1;
while (i < 101) {
    if (i == 99) {
        alert("The number is " + i);
    }
    i++;
}

</script>
</body>
</html>








3.6.while
3.6.1.while loop
3.6.2.Use integer variable to control the while loop
3.6.3.Check the loop counter for while loop
3.6.4.Use while loop to output all elements in an array
3.6.5.Use Do while loop to reverse a string
3.6.6.Nesting If statement to a while statement
3.6.7.Using While loop to check user input