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.
10 lines (9 loc) • 304 B
TypeScript
/**
* Calculates the number of permutations (nPk).
* @param {number} n - The total number of items.
* @param {number} [k] - The number of items to arrange.
* @returns The number of possible permutations.
* @example
* perm(3, 2); // 6
*/
export declare function perm(n: number, k?: number): number;