filterItems()function
filterItems(items: Iterable<T>, match: Match<[T, ...A]>, ...args: A): Iterable<T>
| Param | Type | |
|---|---|---|
items | Iterable<T> | Iterable of items to filter. required |
match | Match<[T, ...A]> | Matcher called with each item (plus any extra args); items it returns true for are kept. required |
args | A | Extra arguments passed to match after each item. required |
| Return | |
|---|---|
Iterable<T> | Iterable yielding only the items the matcher returned true for. |
Filter an iterable set of items using a matcher.
Examples
Array.from(filterItems([1, 2, 3], n => n > 1)) // [2, 3]