Do / While VS While is a matter of when the condition is checked.
A while loop checks the condition, then executes the loop. A Do/While executes the loop and then checks the conditions.
For example, if the counterTwo variable was 10 or greater, then do/while loop would execute once, while your normal while loop would not execute the loop.
javascript - The do-while statement - Stack Overflow
Basic JavaScript - Iterate with JavaScript Do...While Loops
How often do you use while loops
The difference between for and while loop [JavaScript]
Videos
What is purpose this attribute for? I understood how this works but couldn't imagine its purpose.
Do / While VS While is a matter of when the condition is checked.
A while loop checks the condition, then executes the loop. A Do/While executes the loop and then checks the conditions.
For example, if the counterTwo variable was 10 or greater, then do/while loop would execute once, while your normal while loop would not execute the loop.
The do-while is guaranteed to run at least once. While the while loop may not run at all.