Spocoman

02. Prime Number Checker

Jan 18th, 2022 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(num) {
  2.  
  3.     let isPrime =
  4.         num === 2 || num === 3 || num === 5 || num === 7 || num % 2 !== 0
  5.         && num % 3 !== 0 && num % 5 !== 0 && num % 7 !== 0;
  6.  
  7.     console.log(isPrime);
  8.  
  9. }
Add Comment
Please, Sign In to add comment