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

This code we used in the last challenge.After learning about do....while loops, don't you think this would work better

re-write the code to

script.js
do { 
 secret = prompt("What is the secret password?");
 if ( secret !== "sesame" ) {
  secret = prompt("What is the secret password?");    
}
} while ( secret)
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>