The main difference from regular while loops is that the first iteration of a do-while loop is guranted to run ,where as it may not neccessary run with a regular while loop.
Syntax
do{
// Code to be executed
}
while(condition);
Example
var i=0;
do{
document.write(i+"<br>");
}
while(i>0);
Copyright ©2022 coderraj.com. All Rights Reserved.