Skip to content

findRemoveLast

findRemoveLast(array, predicate)

Finds the last element in array that satisfies the provided predicate function and removes it, returning a new array without the removed element.

ts
findRemoveLast([1, 2, 3, 4], (x) => x > 2); // [1, 2, 3]
ts
pipe(
    [1, 2, 3, 4],
    findRemoveLast((x) => x > 2),
); // [1, 2, 3]