Basic JavaScript: Iterate with JavaScript Do...While Loops

In the curriculum update this topic has been included, I get how this works I just wonder why you would ever use it. are there examples of when this would be desired? Couldn’t you just declare a variable with the value you want to log from this do while loop? or is this just included to help us debug problems if somehow we mess up a while loop and see that it’s not iterating correctly because we included a do?

share the link to the challenge

1 Like

randelldawson added it below. sorry for not including it initally.

do…while is only really useful for times when you really need to execute some statement before checking if it’s truthy. You’ll hardly ever need it, but you may see some in the wild.