How to use the D0....While Loop?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to use the D0....While Loop??

could you give me a practicle example of how to use the D0....While Loop in JS??

15th Jul 2020, 1:13 PM
lina swity
lina swity - avatar
2 Answers
+ 5
Do while loop is generally used when we want the loop to execute at least once. You do this in the programmes which once executed asked user wether to restart it or not by putting the entire program in a do..while loop.
15th Jul 2020, 1:18 PM
Arsenic
Arsenic - avatar
+ 3
var x = 10; do { console.log(x--); } while(x>0);
15th Jul 2020, 1:20 PM
HonFu
HonFu - avatar