For this Question: Given a number n find the number of prime numbers less than equal to that number.There is only one integer containing value of n.

Constraints:-
1 <= n <= 10000000Return number of primes less than or equal to nSample Input
5

Sample Output
3

Explanation:-
2 3 and 5 are the required primes.

Sample Input
5000

Sample Output
669, I have written this Solution Code: function numberOfPrimes(N)
   {
      let arr = new Array(N+1);
      
      for(let i = 0; i <= N; i++)
         arr[i] = 0;

      for(let i=2; i<= N/2; i++) 
      {
                if(arr[i] === -1) 
                {
                    continue;
                }

                let p = i;

                for(let j=2; p*j<= N; j++) 
                {
                    arr[p*j] = -1;
                }
      }
      //console.log(arr);

      let count = 0;
      for(let i=2; i<= N; i++) 
      {

          if(arr[i] === 0) 
          {
              count++;
          }
      }
      //console.log(arr);
      return count;
   }, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?