The while and do ... while loops are very similar. They both allow you to run a certain piece of code over and over again until some condition is met. That condition goes inside parentheses after the while keyword.

The condition, can be anything that you want, as long as it evaluates truthy (if you want to go in to the loop) and will eventually evaulate to falsy. If it never evaluates to falsy, you'll be stuck in an infinite loop, or a you'll be stuck in the loop with no way to exit. So make sure that you provide some sort of expression that can evaluate to both truthy and falsy at least once.

For more information on the these loops, read this blog post.