Skip to content

Instantly share code, notes, and snippets.

@marcmartino
Created August 24, 2016 23:43
Show Gist options
  • Save marcmartino/755ce7ce7e426cd475c111b4a0775fcd to your computer and use it in GitHub Desktop.
Save marcmartino/755ce7ce7e426cd475c111b4a0775fcd to your computer and use it in GitHub Desktop.
function findPrimeFact(num, accum = []) {
return 1;
}
function isDivisible(num) {
return (divisor) => num % divisor === 0;
}
function isPrime(num) {
return Array.from({length: Math.floor(num/4 - 1)},
(x, i) => i * 2 + 3)
.filter(isDivisible(num)).length === 0;
}
//findPrimeFact(600851475143);
//not functional atm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment