SHARE
TWEET

Algorythm task

a guest Sep 22nd, 2019 63 in 155 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function isPrime(num){
  2.   if(num < 2) return false;
  3.     for (var i = 2; i < num; i++) {
  4.         if(num % i == 0)
  5.             return false;
  6.     }
  7.     return true;
  8. }
  9.  
  10. function makeArrC(arrayA,arrayB){
  11.  
  12.  const arrayC = arrayA.filter(arrayItemA=>{
  13.     let numberCount=0;
  14.    
  15.     arrayB.forEach(arrayItemB=>{
  16.       if(arrayItemB === arrayItemA)
  17.         numberCount++;
  18.     })
  19.    return !isPrime(numberCount);
  20.   })
  21.   return arrayC
  22. }
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