Is the prime number judged?
Prime numbers (prime number) are also called prime numbers, with an infinite number. A prime number is defined as a number of natural numbers greater than 1, except for 1 and its own no longer have other factors than the numbers called prime numbers.
composite numbers, mathematical expressions, English name composite number, in addition to the natural number can be 1 and its own integer, but also by the number of other (except 0) is divisible. Relative to the prime number (factor only 1 and itself, such as 2,3,5,7,11,13, etc., also known as Prime), and 1 is neither prime nor composite. The smallest composite is 4.
It is worth noting that here we can use the isNaN () method to determine whether user input is legitimate:
Alert (isNaN (NaN)); True
alert (isNaN); False (10 is a numeric value)
alert (isNaN ("ten")),//false (can be converted to numeric)
alert (isNaN ("Blue"));//true (cannot be converted to numeric values)
Alert (isNaN (true));//false (can be converted to a value of 1)
The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring some help, if there are questions you can message exchange, but also hope that a lot of support cloud Habitat community!