function get_primes(arr) { return arr.filter((x) => { if(x <= 1){return false;} if(x === 2 || x === 3){return true;} for(let i = 2; i <= parseInt(x/2); i++){ if(x%i==0){ return false; }else{ continue; } } return true; }); }
Sign in to make a reply
阿光与阿曦