Solve the meaning of a piece of js code

I am a rookie. I have a doubt about the following code. The code is as follows:

function showPrimes(n) {
  nextPrime: for (let i = 2; i < n; iPP) {
                for (let j = 2; j < i; jPP) {
                  if (i % j == 0) continue nextPrime;
                }
                alert( i ); // a prime
              }
}

the output result is: 2, br 3, 5, 5, 7, < 3 > Why is there no 9?
is there an old driver to explain? thank you!

Is

9 a prime number?


calculate prime numbers.

each number is removed in turn to a number smaller than him, as long as it can be divisible, jump out of the loop, indicating that it is not a prime, jump out of the inner loop, and calculate the next number.

9 divided by 3 is divisible.

Menu