function isPrime(num) {
if (num < 2) return false;
const allFactors = Array.from({length: num - 1 }, (_, i) => i + 2)
const factorsUneven = filter( n => n == 2 || n % 2 !== 0, allFactors)
const biggest_possible_factor = Math.floor(num / 2);
const factorsReduced = filter(n => n <= biggest_possible_factor, factorsUneven)
const factors = filter(n => (num % n == 0 ), factorsReduced)
return factors.length == 0
}