title: How to ask a user to guess a number between 1 - 1000
body: <p>I'm trying to write some javascript code that asks the user to guess a number from 1 to 1000 and enter it into the prompt box. If the user guesses right, an alert box will pop up saying they got it right. If they guess wrong, another alert box will popup and say that they are wrong and to try once more.</p>
  
  <p>The issue here is that I don't know what I have to do to make the code loop infinitely until they get the right answer. Here's what i have so far:</p>
  
  <pre><code>var a = 489; // the number that needs to be guessed to win the game.
  
  //var b stores whatever value the user enters.
  var b = prompt("Enter a number in between 1 and 1000");
  
  // if/else statement that test if the variables are equal.
  if (b == a) {
      alert("You're right!");
  } else {
      alert("Incorrect! Try again!");
  }
  </code></pre>