whereValue method

Map<K, V> whereValue(
  1. Predicate<V> p
)

Returns a new Map by filtering its values using the given predicate.

Implementation

Map<K, V> whereValue(Predicate<V> p) {
  Map<K, V> map = {};

  forEach((k, v) {
    if (p(v)) map[k] = v;
  });

  return map;
}