Returns the first element having the largest value according to the provided
comparator or undefined if there are no elements.
The comparator is expected to work exactly like one passed to Array.sort,
which means that comparator(a, b) should return a negative number if
a < b, a positive number if a > b and 0 if a === b.
Returns the first element having the largest value according to the provided comparator or undefined if there are no elements.
The comparator is expected to work exactly like one passed to
Array.sort, which means thatcomparator(a, b)should return a negative number ifa < b, a positive number ifa > band0ifa === b.