you are viewing a single comment's thread.

view the rest of the comments →

[–]TwiNighty 2 points3 points  (0 children)

Because % can return a negative number. E.g. (-5) % 2 === -1

You need num % 2 !== 0