Options
All
  • Public
  • Public/Protected
  • All
Menu

Module dropRightWhile

Index

References

Functions Array

References

Renames and re-exports dropRightWhile

Array Functions

  • dropRightWhile<T>(array: T[], predicate: any): T[]
  • Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).

    since

    5.16.0

    example
    const users = [
    { 'user': 'barney', 'active': false },
    { 'user': 'fred', 'active': true },
    { 'user': 'pebbles', 'active': true }
    ]

    dropRightWhile(users, ({ active }) => active)
    // => objects for ['barney']

    Type parameters

    • T

    Parameters

    • array: T[]

      The array to query.

    • predicate: any

      The function invoked per iteration.

    Returns T[]

    Returns the slice of array.