operator - method

Vector<T> operator -(
  1. Vector<T> other
)

Removes all occurrences of elements found in other

Implementation

Vector<T> operator -(Vector<T> other) {
  final newList = _data
      .where((element) => !other._data.contains(element))
      .toList();
  return Vector<T>(newList);
}