title: Can someone explain this javascript code I took from MDM web docs?
body: <p>I understand everything about this code (or at least I thought I did) except the fact that it includes the number &quot;2&quot; in the new filtered array. I know the code is supposed to return all prime numbers but if (num % i == 0) { return false }, shouldn't that make it so that it skips the number &quot;2&quot;?</p>
  <pre><code>const array = [-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
  
  function isPrime(num) {
    for (let i = 2; num &gt; i; i++) {
      if (num % i == 0) {
        return false;
      }
    }
    return num &gt; 1;
  }
  
  console.log(array.filter(isPrime)); // [2, 3, 5, 7, 11, 13]
  
  </code></pre>
  <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter</a></p>