Creates a function that returns the last element from an iterable, with optional sorting. If a comparator is provided, sorts the values before returning the last element. Otherwise, returns the last element from the values in their original order.
Optional
Optional comparator function to use for sorting
A function that takes an iterable and returns its last element
Error if the iterable is empty
maybeLast for a non-throwing variant
Creates a function that returns the last element from an iterable, with optional sorting. If a comparator is provided, sorts the values before returning the last element. Otherwise, returns the last element from the values in their original order.