DEV Community

Discussion on: Can you hack this? #2

Collapse
 
jonathanarnault profile image
Jonathan ARNAULT • Edited

One liner solution :

const isEven = (n) => (+n && (n & 1)) === 0
Enter fullscreen mode Exit fullscreen mode