Advertisement
Mvelchev

Untitled

May 29th, 2022
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function isPrime(num) {
  2.     if (num<2)
  3.      return false;
  4.    
  5.     for (let  i =2 ; i < num ; i++){
  6.         if (num % 2 == 0){
  7.             return false;
  8.         }
  9.         return true;
  10.     }
  11.  
  12.        
  13.    
  14. }
  15. console.log(isPrime(81));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement