Deviopath › JavaScript

Prime Number Check

Medium · Math

Write a function isPrime that returns true if n is a prime number: a whole number greater than 1 that is divisible only by 1 and itself.

Numbers below 2 are not prime.

Next: GCD and LCM