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 trialDhruvan Sampath
1,251 PointsI am getting a parse error when running below: where is my syntax off?
I've ran this in treehouse work space and it works fine. It doesn't seem to work under this challenge. Please help!
let secret;
let password = "sesame";
do {
secret = prompt("What is the secret password?");
} while (secret!= password);
document.write("You know the secret password. Welcome.");
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
Steven Parker
231,275 PointsThis is an older course and the parser apparently doesn't understand "let". Use "var" as was originally provided in the code instead.
Dhruvan Sampath
1,251 PointsThanks everyone. I switched the variable to bar and it worked.
Steven Parker
231,275 PointsDhruvan Sampath — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!
Michael Cook
Full Stack JavaScript Techdegree Graduate 28,975 PointsMichael Cook
Full Stack JavaScript Techdegree Graduate 28,975 PointsI ran your code in my Chrome console and it works fine. Some times the challenges are buggy. I suggest just refreshing the page and trying again.