method StreamClass.prototype.reject
Private
StreamClass.prototype.reject(predicate: (
value: T,
index: number
) => boolean
): StreamClass<T, E>

Drops the values predicate accepts — filter's complement; failures pass through.

await Stream.from([1, 2, 3, 4]).reject((n) => n % 2 === 0).collect(); // [1, 3]

Parameters

predicate: (
value: T,
index: number
) => boolean

Return Type

Usage

import { StreamClass } from "lib/stream/stream.ts";