Welcome to the Treehouse Community
Looking to learn something new?
Why do I have to repeat the content of secret?
Why can't I run secret inside of the while loop? Why do I have to repeat myself inside and outside the loop: secret = prompt("What is the secret password?")
Jeremy Hamilton7,229 Points
I assume you were simply on the while loop exercise, and that's how you'd run it inside the while loop since the loop doesn't run until you've met a value. When you move onto the do...while loop, then you'll get to a situation like the one you want more, a loop that runs at least once, so you can put the first question inside of the loop.