takeRightWhile
Import from @varavel/vdl-plugin-sdk/utils/arrays.
Takes elements from the end of the array while the predicate function returns true.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
Type of elements in the input array. |
Parameters
| Parameter | Type | Description |
|---|---|---|
arr |
readonly T[] |
The array to take elements from. |
shouldContinueTaking |
(item, index, array) => boolean |
The function invoked per element with the item, its index, and the array. |
Returns
T[]
A new array containing the elements taken from the end while the predicate returns true.