any method

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

Returns true if at least one element matches the given predicate.

Implementation

bool any(bool predicate(T element)) {
  if (isNullOrEmpty()) return false;
  for (final element in this!) {
    if (predicate(element)) return true;
  }
  return false;
}