Skip to content

max

Module Export

[value] |> number

Takes an iterator and returns the highest value.

If the iterator is an iterator of objects, a function is required to extract the value to compare. If the iterator is empty, the result is nothing. If two objects are equal, the last one is returned.

Examples

import 'iterators'
from [1, 2, 3] max
from [{ value: 1 }, { value: 2 }, { value: 3 }] max x => x.value