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)
        • (x): boolean
        • Parameters

          Returns boolean

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

      • (source): V[]
      • Parameters

        • source: readonly V[]

        Returns V[]