Last updated 4 years ago
Was this helpful?
const f = (n) => (Number.isInteger(n) && n > 0) ? n * (n + 1) / 2 : false;