is-number-even-or-odd
v1.0.2
Published
Check if a number is even or odd
Downloads
43,815
Maintainers
Readme
is-number-even-or-odd
You may or may not want to use it :)
List of Features
- Check if the number is even or not
- Check if the number is odd or not
- Check if the number is even or odd
Download & Installation
$ npm i is-number-even-or-odd
Example Usage
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
License
This project is licensed under the MIT License