factorial-calculator

2.1.0 • Public • Published

factorial-calculator

A simple module to calculate the factorial of a number

Installation

Install via NPM:

npm install factorial-calculator

Usage

JavaScript (node)

const factorial = require("factorial-calculator/dist-node");

factorial(5); // 5*4*3*2*1 -> 120

TypeScript / JavaScript

import factorial from 'factorial-calculator/src';

factorial(4); // 4*3*2*1 -> 24

If function's argument less than 0 (negative number) or not a number at all the factorial function will return NaN

Repo

https://github.com/gsvidal/factorial-calculator

Readme

Keywords

Package Sidebar

Install

npm i factorial-calculator

Weekly Downloads

4

Version

2.1.0

License

ISC

Unpacked Size

2.38 kB

Total Files

5

Last publish

Collaborators

  • gsvidal