removeWhere method

IList<T> removeWhere(
  1. Predicate<T> test
)

Removes all objects from this list that satisfy test.

An object o satisfies test if test(o) is true.

final IList<String> numbers = ['one', 'two', 'three', 'four'].lock;
final IList<String> newNumbers = numbers.removeWhere((item) => item.length == 3);
newNumbers.join(', '); // 'three, four'

Implementation

IList<T> removeWhere(Predicate<T> test) {
  // TODO: Still need to implement efficiently.
  var list = toList(growable: true);
  list.removeWhere(test);
  return IList._unsafeFromList(list, config: config);
}