Function some

Returns true if at least one element in the array satisfies the provided testing function.

const source = [1, 2, 3];
const fn = (value: number) => value > 2;
some(fn)(source) // true
  • Type Parameters

    • A

    Parameters

    • fn: ((value: A) => boolean)
        • (value): boolean
        • Parameters

          • value: A

          Returns boolean

    Returns (<S>(source: S) => boolean)

      • <S>(source): boolean
      • Type Parameters

        • S extends readonly A[]

        Parameters

        • source: S

        Returns boolean