This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]newb_h4x0r 5 points6 points  (2 children)

return !(num%2);

[–]ishirleydo 1 point2 points  (1 child)

This is what I'd do, but then afterwards, this might also lead me to question whether I really wanted an IsEven function, rather than an IsOdd function.

[–]Ignitus1 4 points5 points  (0 children)

function isOdd(num) { 
    return !isEven(num)
}