List Filters

suggest change

Introduction

Iterable.where and List.retainWhere both take a function that returns true or false for each element.

where returns a new lazy Iterable of the elements for which the function returns true. It does not modify the original list. retainWhere removes every element for which the function returns false, updating the list in place.

theList.retainWhere(test) is similar to theList = theList.where(test).toList(), except retainWhere changes the existing list instead of assigning a new one.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents