JavaScript While Loop


---------

index.js page

let num = 10;

while (num >= 10) {

  console.log("adisma");

  num = num - 1; // num--;

}

------------------------------------------------------------------------------------------

default.js page
-----------

 <script>

      let num = 30;

      while(num>=1){
        document.write(num + ") Adisma <br>")
        num = num-1; // num--;
      }

    </script>

-----------------------------------------------








Comments

Popular posts from this blog

Javascript Array Concat and Join Method

JavaScript pop() Method