filter
filter :: (Function predicate, Collection collection) => Collection | Promise<Collection>description
const values = [0, 1, 2, 3]
const isEven = x => x % 2 === 0
filter(isEven, values) // [0, 2]const values = [0, 1, 2, 3]
const isEven = async x => x % 2 === 0
filter(double, values) // Promise<Pending>
await filter(double, values) // [0, 2]examples
basic example
import { filter } from 'conductor'
const values = [0, 1, 2, 3]
const isEven = x => x % 2 === 0
filter(isEven, values) // [0, 2]other data structures
using the index in the predicate function
using an asynchronous predicate
Last updated