title: Javascript prime number check
body: <p>I've been trying to pass a challenge for so long, and despite reading up multiple solutions and advice online I can't seem to apply it correctly. </p>
  
  <p>The instructions are "Define a function isPrime that takes one integer argument and returns true or false depending on if the integer is a prime." </p>
  
  <p>I've tried a lot of things but this is the furthest I've been able to get: </p>
  
  <pre><code>function isPrime(num) {
    if (num &lt;= 1) return false;
    if (num === 2) return true;
  
    for (var i = 2; i &lt; num; i++) 
      if (num % i === 0) return false;
      else return true;
  }
  </code></pre>
  
  <p>But then I'm told: "9 is not a prime number." </p>
  
  <p>Any help would be appreciated and thanks! </p>