You may or may not want to use it :)
- Check if the number is even or not
- Check if the number is odd or not
- Check if the number is even or odd
$ npm i is-number-even-or-odd
const {isEven,isOdd,isEvenOrOdd} = require("is-number-even-or-odd")
// isEven -> returns true or false
const test1 = isEven(2)
// isOdd -> returns true or false
const test2 = isOdd(2)
// isEvenOrOdd -> returns "even", "odd" or "error"
const test3 = isEvenOrOdd(3)
const test4 = isEvenOrOdd('a')
console.log(test1) // true
console.log(test2) // false
console.log(test3) // odd
console.log(test4) // error
This project is licensed under the MIT License