2.0.2 • Published 5 months ago

num-is-even-or-odd v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

num-is-even-or-odd NPM version NPM monthly downloads NPM total downloads

Return even or odd to as result to a given number.

Install

Install with npm:

$ npm install -D num-is-even-or-odd

Usage

import { evenOrOdd } from 'num-is-even-or-odd'

const { isEvenOrOdd, isEven, isOdd } = evenOrOdd()

// Method to verify even and odd

console.log(isEvenOrOdd(3)); //=> "odd"
console.log(isEvenOrOdd(4)); //=> "even"

// You can pass a "returnAsBool" boolean parameter to return results as boolean, true to even and false to odd, default value for parameter is false

console.log(isEvenOrOdd(3, true)); //=> false (odd)
console.log(isEvenOrOdd(4, true)); //=> true (even)

// Method to verify if the value is odd

console.log(isOdd(3)); //=> true
console.log(isOdd(4)); //=> false

// Method to verify if the value is even

console.log(isEven(3)); //=> false
console.log(isEven(4)); //=> true

Author

Otavio Rampinelli

License

Copyright © 2023, Otavio Rampinelli. Released under the MIT License.


2.0.2

5 months ago

2.0.1

5 months ago

2.0.0

5 months ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago