Skip to content

maxOr

maxOr(array, fallback)

Returns the maximum value in the number array, or fallback if the array is empty.

ts
maxOr([1, 3, 2, 5], 0); // 5
ts
pipe([1, 3, 2, 5], maxOr(0)); // 5