Ad
Mathematics
Algorithms
Logic
Numbers
Data Types

Write a function that checks if a number is a perfect number.
(All divisors except itself when added up equal the original number)

https://en.wikipedia.org/wiki/Perfect_number

const isPerfect = n => 
  Array(n - 1).fill(1).map((e, i) => e + i).filter(e => n % e === 0).reduce((a, b) => a + b) === n