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 trialViki Bigler
4,664 Pointsfor the do...while loop challenge, my code is taking too long to run. Is this because its wrong?
my code looks like:
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 PointsHi Viki, You need to assign a value to sesame and it will work.
4 Answers
Viki Bigler
4,664 PointsHi Dale, thanks! Sadly, I find I don't understand what you mean. I added:
var sesame = answer;
but then it couldn't find the variable answer. Please will you elaborate? Thank you.
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 Pointsvar sesame='sesame';
You are comparing to an empty variable, that's why its not completing the loop.
Jason Anders
Treehouse Moderator 145,860 PointsHey Viki.
Your code is correct, except for one small thing: you are missing the quotes around sesame to make it a string.
if (secret === "sesame") { -- added quotes
Keep Coding! :)
Viki Bigler
4,664 PointsThnk you Dale! Now I get it.
Viki Bigler
4,664 PointsThanks Jason! I had the quotes at one point but must have had something extra 'cuz it didn't work, but that works, yay!
Viki Bigler
4,664 PointsViki Bigler
4,664 Points