Ads Top

Javascript while Loop

Syntax Code:
While(condition){

      Statement………..

      Increment/decrement

}

Javascript while loop Example:
<script>
      var a =1;
      while (a<=10){
            document.write(a + "<br>");
      a++;
}
</script>

Result:

1
2
3
4
5
6
7
8
9
10

No comments:

Copyright Reserved to Anything Learn. Powered by Blogger.