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 trialTsipporah Christopher
Full Stack JavaScript Techdegree Graduate 15,593 PointsWhy do I keep getting an error with my code?
Here is my code. Can someone please advise me on what I am doing wrong for this do...while loop challenge? Thank you.
// Display the prompt dialogue while the value assigned to `secret` is not equal to "sesame"
let secret = prompt("What is the secret password?");
const password = "seseme";
//check the passwrd, if it is false (secret !== seseme), run the alert prompt, until secret = seseme
do {
secret = prompt("What is the secret password?");
} while ( secret !== password );
// This should run after the loop is done executing
alert("You know the secret password. Welcome!");
2 Answers
eotfofiw
Python Development Techdegree Student 824 PointsGreat work, you've solved the challenge. There's a simple change to make in there to get the "Check Work" test to pass your solution.
Read the last line of the requirements very carefully:
Add a do...while loop that keeps displaying the prompt dialog until the user types 'sesame'.
Tsipporah Christopher
Full Stack JavaScript Techdegree Graduate 15,593 PointsOh I came back to it today and noticed the typo in sesame haha >.< Thank you so much!!