Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/all

Index

References

Functions

References

Renames and re-exports all

Functions

  • all<T>(fn: ArrPred<T>, list: ArrayLike<T>): boolean
  • all<T>(fn: ArrPred<T>): (list: ArrayLike<T>) => boolean
  • Returns true if all the elements of the array match the predicate, false otherwise.

    example
     var lessThan2 = x => x < 2;
    var lessThan3 = x => x < 3;
    all(lessThan2)([1, 2]); //=> false
    all(lessThan3)([1, 2]); //=> true

    Type parameters

    • T

    Parameters

    • fn: ArrPred<T>

      The predicate function.

    • list: ArrayLike<T>

    Returns boolean

    true if the predicate is satisfied all elements, false otherwise.

  • Returns true if all the elements of the array match the predicate, false otherwise.

    example
     var lessThan2 = x => x < 2;
    var lessThan3 = x => x < 3;
    all(lessThan2)([1, 2]); //=> false
    all(lessThan3)([1, 2]); //=> true

    Type parameters

    • T

    Parameters

    • fn: ArrPred<T>

      The predicate function.

    Returns (list: ArrayLike<T>) => boolean

    true if the predicate is satisfied all elements, false otherwise.

      • (list: ArrayLike<T>): boolean
      • Parameters

        • list: ArrayLike<T>

        Returns boolean

Generated using TypeDoc