I read the title and I sarcastically thought "ask JavaScript!"
Your comment didn't disappoint. Importing the is-even package is the cherry on top.
I would have thought the reverse, but ¯\_(ツ)_/¯
And if you implement, e.g.:
function IsEven(x) { return x % 2 == 0; }
function IsOdd(x) { return x % 2 == 1; }
Then IsEven(Infinity) == false and IsOdd(Infinity) == false, as expected.