Learning JavaScript tutorial – JavaScript while(loop), do…while(Loop) statement
JavaScript while statement
In JavaScript, while loop statement allows us to perform some action on a piece of code till the condition is satisfied or true. The JavaScript while loop statement check condition at the start of the execution of the loop. If the expression evaluates to true, the while loop statement execute the body of the loop; means the piece of code between the curly brackets.
JavaScript while statement Syntax
while(conditional expression is true)
{
statement block executed while conditional expression
evaluates to true(satisfied).
}
Here, If the resulting value of conditional expression is true or it evaluated to true, while loop statement block enclosed within the Curly braces – {} is executed.

do while loop statement flowchart




