Hacker News new | ask | show | jobs
by darepublic 1896 days ago
Nit, the x is a copy so it won't change the value of x outside the function. So I would rewrite ad

const foo = x => x !== null ? x + 2 : null