versionend
v1.0.2
Published
last version
Downloads
4
Readme
Utility Functions Package
This package provides a collection of utility functions for common tasks in JavaScript.
Installation
Install the package using npm:
npm install utility-functions
Usage
- 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
Available Functions
isEven(num)
Returns true
if the given number is even, otherwise returns false
.
isOdd(num)
Returns true
if the given number is odd, otherwise returns false
.
factorial(num)
Calculates the factorial of the given number and returns the result.
License
This package is licensed under the MIT License. See the LICENSE file for details.