In javascript, do-while loop is the only loop which executes at least once, if the condition is false.
because it iterates first and then checks the condition.
Syntax
initialization; // outside of loop
do {
// set of statements
iteration;
}
while (condition);
Example
<script>
let i = 0;
do{
document.write(i);
i++;
} while(i < 20);
</script>
In above example, do-while loop prints number from 0 -19.