containsWhere method

bool containsWhere(
  1. bool test(
    1. T element
    )
)

Checks whether any element satisfies the test function.

This is a Swift-like alias for Dart's any method.

Example:

Iterable<int> numbers = [1, 2, 3, 4, 5];
bool hasLargeNumber = numbers.containsWhere((n) => n > 3); // true

Implementation

bool containsWhere(bool Function(T element) test) {
  return any(test);
}