Returns true if a number is odd, false if even, null if not implemented yet (troll version - updates coming soon!)
npm install @hwycdfatm/is-odd> Returns true if a number is odd, false if even, null if not implemented yet.
ā ļø This is a "work in progress" package that implements odd number checking one number at a time. Currently only supports limited cases. More updates coming soon! š
Install with npm:
``sh`
npm install @hwycdfatm/is-odd
`js
const isOdd = require('@hwycdfatm/is-odd');
console.log(isOdd(1)); // => true (implemented!)
console.log(isOdd(2)); // => false (implemented!)
console.log(isOdd(3)); // => true (implemented!)
console.log(isOdd(5)); // => true (implemented!)
`
Version 0.0.2 - Only the following cases are implemented:
ā
isOdd(1) ā true isOdd(2)
ā
ā false null
ā All other numbers ā (not implemented yet)
This package will be updated regularly with more number support. Stay tuned!
Checks if the given number is odd.
Params
* number {Number}: The number to check
Returns
* {Boolean|null}:
- Returns true if the number is odd (when implemented)false
- Returns if the number is even (when implemented)null
- Returns if not implemented yetTypeError
- Throws if input is not a finite number
Example
`js
const isOdd = require('@hwycdfatm/is-odd');
console.log(isOdd(1)); // => true
console.log(isOdd(3)); // => true
console.log(isOdd(NaN)); // => throws TypeError
console.log(isOdd(Infinity)); // => throws TypeError
`
This package includes TypeScript definitions.
`typescript
import isOdd = require('@hwycdfatm/is-odd');
const result = isOdd(1); // true
const result2 = isOdd(3); // true
``
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
hwycdfatm
Copyright Ā© 2026, [hwycdfatm].
Released under the MIT License.