Function reject

Rejects all the elements of an array that satisfy the condition specified in a callback function.

const source = [1, 2, 3];
const predicate = (x: number) => x % 2 === 0;
reject(predicate)(source) // [1, 3]
  • Type Parameters

    • V

    Parameters

    • fn: (x: V) => boolean

    Returns (source: readonly V[]) => V[]