any method

bool any(
  1. bool predicate(
    1. E element
    )
)

Returns true if any element matches the given predicate.

Implementation

bool any(bool Function(E element) predicate) {
  for (final element in this) {
    if (predicate(element)) return true;
  }
  return false;
}