Sunday, June 10, 2018

JavaScript - Control Structures - while Loop

Below construct demonstrates usage of while loop in JavaScript:

var myNum = 3;

while(myNum < 7){
  
  console.log("myNum =="+myNum);
  myNum++;
  
}

Try it out at: http://jsbin.com

No comments:

Post a Comment