title: Finding prime number in a range in javascript
body: <p>I'm trying to solve this problem where you loop through the numbers between 1 to 60 to find the total prime numbers. Here is what I've come up with:</p>
  <pre><code>var totalPrimeNumber = 0;
  for(let i=1; i&lt;=60; i++) {
      for(let j= 2; j&lt; i; j++) {
          if(i%j ==0) {
              console.log(i, &quot;is not a prime number&quot;);
          }
          console.log(i, &quot;is a prime number&quot;);
          totalPrimeNumber+=1;
      }
  }
  </code></pre>
  <p>But the output is wrong:</p>
  <pre><code>3 is a prime number
  4 is not a prime number
  4 is a prime number
  4 is a prime number
  5 is a prime number
  5 is a prime number
  5 is a prime number
  6 is not a prime number
  6 is a prime number
  6 is not a prime number
  6 is a prime number
  6 is a prime number
  6 is a prime number
  7 is a prime number
  7 is a prime number
  7 is a prime number
  </code></pre>
  <p>Do you know how I can fix this problem?</p>