title: Javascript - Find if number is positive or negative
body: <p>I see other solutions to my question but none that help me.</p>
  
  <p>I want to create a function to find if a number is positive/negative. The function should take an integer argument and return true if the integer is positive and false if it is negative.</p>
  
  <p>Also, prompt the user again and again if anything other than a number is entered</p>
  
  <p>Here's the code so far</p>
  
  <p>When I enter a number, it keeps alerting me it is true or false but won't let me enter another.
  How do I control my loop so I can ask until <code>-1</code> is entered? It is not giving me a chance to enter -1</p>
  
  <pre><code>function isPositive(num) {
  
      var result;
  
      if (num &gt;= 0) {
          result = true;
      } else if (num &lt; 0) {
          result = false;
      }
      return result;
  }
  
  var num;
  num = parseInt(prompt("Enter a number"));
  while (num != -1) {
      alert(isPositive(num));
  
      if (isNaN(num)) {
          alert("No number entered. Try again");
          num = parseInt(prompt("Enter a number"));
          isPositive(num);
          while (num != -1) {
              alert(isPositive(num));
          }
      }
  }
  </code></pre>