2.0.2 • Published 11 months ago

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

Weekly downloads
-
License
MIT
Repository
-
Last release
11 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

11 months ago

2.0.1

11 months ago

2.0.0

11 months ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago