The condition to drop the suffix.
The list dropped the matched suffix.
import { dropWhileEnd, fromArray, toArray, toIterator } from "./list.ts";
import { assertEquals } from "../deps.ts";
assertEquals([
...toIterator(
dropWhileEnd((x: number) => x < 3)(
fromArray([1, 2, 3, 4, 5, 1, 2]),
),
),
], [1, 2, 3, 4, 5]);
assertEquals(
toArray(dropWhileEnd((x: number) => x < 9)(fromArray([1, 2, 3]))),
[],
);
assertEquals(
toArray(dropWhileEnd((x: number) => x < 0)(fromArray([1, 2, 3]))),
[1, 2, 3],
);
Generated using TypeDoc
Drops the largest suffix of the list in which
pred
holds for all elements of the suffix.