npm i is-even
const isEven = require("is-even");
console.log(isEven(Infinity));
TypeError: is-odd expects a number. npm i is-even
const isEven = require("is-even");
console.log(isEven(Infinity));
TypeError: is-odd expects a number.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.