Sunday, June 10, 2018

JavaScript - Control Structures - do while loop

Below example demonstrates usage of do while loop:

var myCondition = false;

do{
  console.log("Inside do");
}
while(myCondition);


try out this example at: http://jsbin.com

do while is used for executing the code at least once - even when the condition is false.

No comments:

Post a Comment