containsAny<E> function

bool containsAny<E>(
  1. Iterable<E> listA,
  2. Iterable<E> listB
)

Check if any elements in the listB is contains in the listA

Implementation

bool containsAny<E>(Iterable<E> listA, Iterable<E> listB) {
  bool result = false;
  for (final E element in listB) {
    if (listA.contains(element)) {
      return true;
    }
  }
  return result;
}