function get_primes(arr) { function isPrime(x){ if(x==1){return false;} //if(x==2){return true;} for(var i=2;i<x;i++){ if (x % i==0){return false;} } return true; } return arr.filter(isPrime); }
Sign in to make a reply
Gingbery