lastBy<S, T> function

Map<T, S> lastBy<S, T>(
  1. Iterable<S> values,
  2. T key(
    1. S
    )
)

Associates the elements in values by the value returned by key.

Returns a map from keys computed by key to the last value for which key returns that key.

Implementation

Map<T, S> lastBy<S, T>(Iterable<S> values, T Function(S) key) =>
    {for (var element in values) key(element): element};