Category
Get the largest value of the 2 parameters. Meant to be used with Array.prototype.reduce.
Array.prototype.reduce
Time complexity: O(1)
Space complexity: O(1)
The next value to compare
previousValue or currentValue, whichever is larger
previousValue
currentValue
Reducers
const array = [1, 2, 3];array.reduce(max); // 3 Copy
const array = [1, 2, 3];array.reduce(max); // 3
Get the largest value of the 2 parameters. Meant to be used with
Array.prototype.reduce
.Time complexity: O(1)
Space complexity: O(1)