Function all

Returns true if the provided predicate function returns true for all elements in a set, otherwise it returns false.

all([4, 2, 3], x => x > 1)
// true

1.0.9

  • Type Parameters

    • T = unknown

    Parameters

    • arr: T[]

      the target array

    • fn: AnyFunction

      the judgment method

    Returns boolean

    • the result of the judgment