Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/any

Index

References

Functions

References

Renames and re-exports any

Functions

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

    example
     var lessThan0 = x => x < 0;
    var lessThan2 = x => x < 2;
    any(lessThan0)([1, 2]); //=> false
    any(lessThan2)([1, 2]); //=> true

    Type parameters

    • T

    Parameters

    • fn: ArrPred<T>

      The predicate function.

    • list: ArrayLike<T>

    Returns boolean

    true if the predicate is satisfied by at least one element, false otherwise.

  • Returns true if at least one of elements of the list match the predicate, false otherwise.

    example
     var lessThan0 = x => x < 0;
    var lessThan2 = x => x < 2;
    any(lessThan0)([1, 2]); //=> false
    any(lessThan2)([1, 2]); //=> true

    Type parameters

    • T

    Parameters

    • fn: ArrPred<T>

      The predicate function.

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

    true if the predicate is satisfied by at least one element, false otherwise.

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

        • list: ArrayLike<T>

        Returns boolean

Generated using TypeDoc