Creates a generator that yields only elements from an iterable that pass a predicate test.
Similar to Array.prototype.filter(), but works with any iterable.
Template: T
Type of elements in the input iterable
Template: U
Type of filtered elements (for type predicates)
Param: predicate
Function to test each element and its index
Returns
A function that takes an iterable and returns a generator of filtered elements
Creates a generator that yields only elements from an iterable that pass a predicate test. Similar to Array.prototype.filter(), but works with any iterable.