Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/takeRightWhile

Index

References

Functions

References

Renames and re-exports takeRightWhile

Functions

  • takeRightWhile(fn: ArrPred<string>, arr: string): string
  • takeRightWhile<T>(fn: ArrPred<T>, arr: ArrayLike<T>): T[]
  • takeRightWhile<T>(fn: ArrPred<T>): { (arr: string): string; (arr: ArrayLike<T>): T[] }
  • Returns a new array|string containing the last n elements of a given array|string, passing each value to the supplied predicate function, and terminating when the predicate function returns false. Excludes the element that caused the predicate function to fail.

    example
     var isNotOne = x => x !== 1;

    takeRightWhile(isNotOne, [1, 2, 3, 4]); //=> [2, 3, 4]

    Parameters

    • fn: ArrPred<string>

      The function called per iteration.

    • arr: string

      The collection to iterate over.

    Returns string

    A new array or string.

  • Returns a new array|string containing the last n elements of a given array|string, passing each value to the supplied predicate function, and terminating when the predicate function returns false. Excludes the element that caused the predicate function to fail.

    example
     var isNotOne = x => x !== 1;

    takeRightWhile(isNotOne, [1, 2, 3, 4]); //=> [2, 3, 4]

    Type parameters

    • T

    Parameters

    • fn: ArrPred<T>

      The function called per iteration.

    • arr: ArrayLike<T>

      The collection to iterate over.

    Returns T[]

    A new array or string.

  • Returns a new array|string containing the last n elements of a given array|string, passing each value to the supplied predicate function, and terminating when the predicate function returns false. Excludes the element that caused the predicate function to fail.

    example
     var isNotOne = x => x !== 1;

    takeRightWhile(isNotOne, [1, 2, 3, 4]); //=> [2, 3, 4]

    Type parameters

    • T

    Parameters

    • fn: ArrPred<T>

      The function called per iteration.

    Returns { (arr: string): string; (arr: ArrayLike<T>): T[] }

    A new array or string.

      • (arr: string): string
      • (arr: ArrayLike<T>): T[]
      • Parameters

        • arr: string

        Returns string

      • Parameters

        • arr: ArrayLike<T>

        Returns T[]

Generated using TypeDoc