At least 99.9% of the time, any number can be odd or even. This uncertainty can be eliminated with number-oddoreven
. As it sports an incredibly fast, open-ended API, you can solve all even or odd related problems with only 1 line.
- See if a number is odd or even
- See if a number is odd or even
- See if a number is odd or even
$ npm i number-oddoreven
Importing (ready for production)
var isoddOrEven = require("number-oddoreven");
Importing (development version)
var isoddOrEven = require("number-oddoreven");
Example usage
var isoddOrEven = require("number-oddoreven");
if (isoddOrEven(3)) {
console.log("The number is odd or even!");
}
- Arnar Freyr Ástvaldsson
- Anders Nyby Christensen
- Frederik Hammer
This project is licensed under the MIT License