SHARE
TWEET

Untitled

nikolayneykov92 Jun 12th, 2019 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let n = 2
  2. let isPrime = n > 1
  3.  
  4. for (let i = 2; i <= Math.sqrt(n); i++) {
  5.   if (n % i === 0) {
  6.     isPrime = false
  7.     break
  8.   }
  9. }
  10.  
  11. console.log(isPrime)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top