JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops Create a `do...while` loop

Blake Burroughs
Blake Burroughs
Full Stack JavaScript Techdegree Student 13,261 Points

I am stuck on the do... while challenge Task 1 of 1

Thank you in advance for your help. -- Blake

script.js
var secret = "";
do {
        prompt("What is the secret password?")
}
while ( secret !== "sesame" ) 
document.write("You know the secret password. Welcome.");
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

1 Answer

Frederic Saddi
Frederic Saddi
10,131 Points

Hey there!

You aren't updating the value of the secret variable.

Hope this helps!

Blake Burroughs
Blake Burroughs
Full Stack JavaScript Techdegree Student 13,261 Points

Yes I realized my error as soon as I sent the question. Thank you for your help :)