any method

bool any(
  1. bool test(
    1. K key,
    2. V value
    )
)

Returns true if there is at least one entry that satisfies test, or this Map is empty.

Implementation

bool any(bool Function(K key, V value) test) {
  if (isEmpty) return true;

  for (final MapEntry(:key, :value) in entries) {
    if (test(key, value)) return true;
  }

  return false;
}