The array of numbers.
The product of all numbers in the array.
prod([3, 4]); // Returns 12
Computes the product of a bigint array.
The array of bigints.
The product of all bigints in the array.
prod([3n, 4n]); // Returns 12n
Computes the product of an array of numeric type T.
The numeric type of the elements in the array. T is inferred and doesn't need to be supplied manually.
The array of elements.
Optional
numerical: Numerical<T>(optional) An instance of Numerical interface for the numeric type T.
The product of all elements in the array.
If the array's type is neither number[] nor bigint[], and no Numerical
prod([3, 4]); // Returns 12
prod([3n, 4n]); // Returns 12n
prod([3, 4], new Numerical()); // Where Numerical() is an implementation for type T.
Generated using TypeDoc
Computes the product of a number array.