@hwycdfatm/is-odd
v0.0.22
Published
Returns true if a number is odd, false if even, null if not implemented yet (troll version - updates coming soon!)
Maintainers
Readme
@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
Install with npm:
npm install @hwycdfatm/is-oddUsage
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!)Current Status
Version 0.0.2 - Only the following cases are implemented:
✅ isOdd(1) → true
✅ isOdd(2) → false
❌ All other numbers → null (not implemented yet)
This package will be updated regularly with more number support. Stay tuned!
API
isOdd(number)
Checks if the given number is odd.
Params
number{Number}: The number to check
Returns
- {Boolean|null}:
- Returns
trueif the number is odd (when implemented) - Returns
falseif the number is even (when implemented) - Returns
nullif not implemented yet - Throws
TypeErrorif input is not a finite number
- Returns
Example
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 TypeErrorTypeScript
This package includes TypeScript definitions.
import isOdd = require('@hwycdfatm/is-odd');
const result = isOdd(1); // true
const result2 = isOdd(3); // trueAbout
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
hwycdfatm
License
Copyright © 2026, [hwycdfatm]. Released under the MIT License.
