UNPKG

es-next-tools

Version:

A comprehensive utility library for JavaScript and TypeScript that provides a wide range of functions for common programming tasks, including mathematical operations, date manipulations, array and object handling, string utilities, and more.

9 lines (8 loc) 285 B
/** * Calculates the factorial of a number. * @param {number} n - The number to calculate the factorial of. * @returns The factorial of the given number, or NaN if the number is negative. * @example * factorial(5); // 120 */ export declare function factorial(n: number): number;