Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/dropWhile

Index

References

Functions

References

Renames and re-exports dropWhile

Functions

  • dropWhile<T>(fn: ArrPred<T>, list: ArrayLike<T>): T[]
  • dropWhile<T>(fn: ArrPred<T>): (list: ArrayLike<T>) => T[]
  • Returns a new list excluding the leading elements of a given list which satisfy the supplied predicate function. It passes each value to the supplied predicate function, skipping elements while the predicate function returns true.

    example
     var lteTwo = x => x <= 2;

    dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=> [3, 4, 3, 2, 1]

    Type parameters

    • T

    Parameters

    • fn: ArrPred<T>

      The function called per iteration.

    • list: ArrayLike<T>

    Returns T[]

    A new array.

  • Returns a new list excluding the leading elements of a given list which satisfy the supplied predicate function. It passes each value to the supplied predicate function, skipping elements while the predicate function returns true.

    example
     var lteTwo = x => x <= 2;

    dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=> [3, 4, 3, 2, 1]

    Type parameters

    • T

    Parameters

    • fn: ArrPred<T>

      The function called per iteration.

    Returns (list: ArrayLike<T>) => T[]

    A new array.

      • (list: ArrayLike<T>): T[]
      • Parameters

        • list: ArrayLike<T>

        Returns T[]

Generated using TypeDoc