maxOf
The maxOf() function returns the largest numeric value of an array (or tuple) without touching the original.
Interactive example
Syntax
typescript
function maxOf<
GenericInput extends readonly number[]
>(
input: GenericInput
): number | undefinedParameters
input: Array of numbers whose maximum is sought.
Return value
The largest number found, or undefined if the array is empty.
See also
minOf- Computes the minimum valuemaxElements- Checks a maximum number of elements
