title: javascript "prompt is not defined" Reference Error
body: <pre><code>(function() {
      var random_num = Math.floor(Math.random()*10) + 1;
      var input_num = prompt("Guess the number between 1 and 10");
      if (input_num &lt; 1 || input_num &gt; 10) {
          alert('the input number is not between 1 and 10');
  
      } else if (random_num == input_num) {
          alert('Good Work');
      } else {
          alert('Not matched, the random number is: ' + random_num);
      }
  
  })();
  </code></pre>
  
  <p>But the IDE displays that "prompt" is not defined. Could someone help me explain why?</p>