Takes elements from the end of the array while the predicate function returns true.
true
Type of elements in the input array.
The array to take elements from.
The function invoked per element.
A new array containing the elements taken from the end while the predicate returns true.
// Returns [3, 2, 1]takeRightWhile([5, 4, 3, 2, 1], n => n < 4); Copy
// Returns [3, 2, 1]takeRightWhile([5, 4, 3, 2, 1], n => n < 4);
// Returns []takeRightWhile([1, 2, 3], n => n > 3); Copy
// Returns []takeRightWhile([1, 2, 3], n => n > 3);
Alias