Returns all elements in the given array after the last element that does not match the given predicate.
The type of the array elements.
The array to take elements from.
The predicate function to determine if an element should be included.
A new array containing all elements after the last element that does not match the predicate.
import { takeLastWhile } from "@std/collections/take-last-while";import { assertEquals } from "@std/assert";const numbers = [1, 2, 3, 4, 5, 6];const result = takeLastWhile(numbers, (number) => number > 4);assertEquals(result, [5, 6]); Copy
import { takeLastWhile } from "@std/collections/take-last-while";import { assertEquals } from "@std/assert";const numbers = [1, 2, 3, 4, 5, 6];const result = takeLastWhile(numbers, (number) => number > 4);assertEquals(result, [5, 6]);
Returns all elements in the given array after the last element that does not match the given predicate.