This package provides a collection of utility functions for common tasks in JavaScript.
Install the package using npm:
npm install utility-functions
- Require the package in your Node.js application:
const { isEven, isOdd, factorial } = require('utility-functions');
- Use the utility functions in your code:
console.log(isEven(4)); // true
console.log(isOdd(4)); // false
console.log(factorial(5)); // 120
Returns true
if the given number is even, otherwise returns false
.
Returns true
if the given number is odd, otherwise returns false
.
Calculates the factorial of the given number and returns the result.
This package is licensed under the MIT License. See the LICENSE file for details.