Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJames Lupher
Full Stack JavaScript Techdegree Student 6,101 PointsProblem with do-while loop solution
I'm having trouble figuring out where to go from here. I've rewatched the videos and gone to StackOverflow.
// Display the prompt dialogue while the value assigned to `secret` is not equal to "sesame"
let secret;
do {
let secret = prompt("What is the secret password?");
} while (secret !== 'sesame')
// This should run after the loop is done executing
alert("You know the secret password. Welcome!");
3 Answers
Joseph Yhu
PHP Development Techdegree Graduate 48,638 PointsRemove let
inside the do while loop.
Manoj Gurung
5,318 PointsNot working still
Joseph Yhu
PHP Development Techdegree Graduate 48,638 PointsIt worked fine for me, just tested it. Hmm.... Could you post your updated code?
Manoj Gurung
5,318 Pointsyes it does thx
Lisa Walters
Front End Web Development Techdegree Graduate 15,255 PointsLisa Walters
Front End Web Development Techdegree Graduate 15,255 PointsHello James! I only know that your code works as long as it is linked to an html file. The only thing that I can see is that you don't need to repeat the "let" the second time you state "secret". Hope that helps! Good luck!