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 trial

JavaScript JavaScript Loops Simplify Repetitive Tasks with Loops Create a do...while loop

Matt WebDev218
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Matt WebDev218
Front End Web Development Techdegree Graduate 18,099 Points

I don't understand why my code isn't accepted, it works fine in the console

The only error message I receive is 'Bummer: Try again!'. No explanation. Please help!

script.js
// Display the prompt dialogue while the value assigned to `secret` is not equal to "sesame"


// This should run after the loop is done executing

let secret;
do {
  secret = prompt("What is the secret password?");
} while (secret != 'seasame');

alert("You know the secret password. Welcome!");

2 Answers

You have a typo: } while (secret != 'seAsame'); (should be sesame), and you have to use the strict not equals operator: !==.