filterItems()function

filterItems(items: Iterable<T>, match: Match<[T, ...A]>, ...args: A): Iterable<T>
ParamType
itemsIterable<T>
Iterable of items to filter. required
matchMatch<[T, ...A]>
Matcher called with each item (plus any extra args); items it returns true for are kept. required
argsA
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]