k88.io Presents: Programming

One-liner JavaScript - Odd or Even

One-liner JavaScript - Odd or Even

Welcome to a new series of JavaScript codes where I try to post a one-liner JavaScript function. This first code is a one-liner code for determining if a number is odd or even:

const isEven = (num) => !Boolean(num % 2);
const isOdd = (num) => Boolean(num % 2);

 

 

How do you rate this article?

1



k88.io Presents: Programming
k88.io Presents: Programming

Just another blog about programming, tricks and tutorials.

Publish0x Publish0x

Reward the author with $0.01 in crypto, and earn yourself as you read!

20% to author / 80% to me.
Rewards are FREE. Publish0x pays them, not you.

Page not displaying correctly?