News for hackers. Stuff that matters.
Re:Using the switch(true) pattern in JavaScript by darepublic on Monday April 12, 2021 @08:17PM (#26786724)
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

There are no comments on this comment yet.