Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

filter

deprecated
@deprecated

Use a closure instead of a thisArg. Signatures accepting a thisArg will be removed in v8.

function filter<T, S extends T, A>(predicate: (
this: A,
value: T,
index: number,
) => value is S
, thisArg: A): OperatorFunction<T, S>;
function filter<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;
function filter<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
function filter<T, A>(predicate: (
this: A,
value: T,
index: number,
) => boolean
, thisArg: A): MonoTypeOperatorFunction<T>;
function filter<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T>;
§
filter<T, S extends T, A>(predicate: (this: A, value: T, index: number) => value is S, thisArg: A): OperatorFunction<T, S>
[src]

§Type Parameters

§
S extends T
[src]

§Parameters

§
predicate: (this: A, value: T, index: number) => value is S
[src]
§
thisArg: A
[src]

§Return Type

§
filter<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>
[src]

§Type Parameters

§
S extends T
[src]

§Parameters

§
predicate: (value: T, index: number) => value is S
[src]

§Return Type

§
filter<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>
[src]

§Type Parameters

§Parameters

§
predicate: BooleanConstructor
[src]
§
filter<T, A>(predicate: (this: A, value: T, index: number) => boolean, thisArg: A): MonoTypeOperatorFunction<T>
[src]

§Type Parameters

§Parameters

§
predicate: (this: A, value: T, index: number) => boolean
[src]
§
thisArg: A
[src]
§
filter<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T>
[src]

§Type Parameters

§Parameters

§
predicate: (value: T, index: number) => boolean
[src]