Filter items in the iterator leaving only the items that fulfill the predicate.
import { pipe } from "yta";import { filter, range, toArray } from "yta/sync";pipe( range(10), filter((n) => n % 2 === 0), toArray(),);// => [0, 2, 4, 6, 8] Copy
import { pipe } from "yta";import { filter, range, toArray } from "yta/sync";pipe( range(10), filter((n) => n % 2 === 0), toArray(),);// => [0, 2, 4, 6, 8]
The item type
The predicated function
Filter items in the iterator leaving only the items that fulfill the predicate.