The do while loop in JavaScript
Do While Loop
The do while loop is similar to while loop. However, it will execute the statement one time even if the condition is not true. In other words, this loop will execute the code block once, before checking if the condition is true, and then it will repeat the loop as long as the condition is true.
Syntax of do while loop is:-
do{
// code to be executed one time if the while the condition is false otherwise as long as the while condition remains true
} while (condition);