DEV Community

Discussion on: The Semantics of Falsy Values

Collapse
 
somedood profile image
Basti Ortiz

Yes, that definitely works, too! However, I believe you meant num % 2 !== 0, though, since we're checking if a number is odd.

Either way, I get your point. That's a valid way of thinking about it rather than the explicit and rather bulky Boolean call.

Collapse
 
yuanhao profile image
YuanHao Chiang

Ooops, yes, edited my post :)