title: Finding the first 100 prime numbers
body: <p>I'm trying to find the FIRST 100 PRIME NUMBERS. Not the primes from 1-100. I need some help with this code.</p>
  
  <pre><code>    var p = function(n){
      var x = Math.sqrt(n);
      if(n==2){return 2;}
      else if (n % 2===0){return 0;}
      var i=3;
      for(i=3; i &lt; x; i+=2){
              if(n%i===0){return 0;}
      }
      return n;
  };
  
  
  var firstKPrime = function(k){
          var i=1;
          var arr =[];
          for(i = 1; i &lt; k+1; i++){
                  if(i==2){arr.push(p(i));}
                  if(i&gt;2 &amp;&amp; i%2!==0){
                          if (p(i)&gt;1){arr.push(p(i));}}
                      }
                  return arr;
              };
  
                  var fmt = function(arr){
                      return arr.join(",");
  
              };
  
              var k = 100;
              console.log("firstKPrime(" + k + ")");
              console.log(fmt(firstKPrime(k))); 
  </code></pre>
  
  <p>I dont want it to find the primes from 1-100 help me with modifying this</p>