Skip to content

removeLast

Array.removeLast(target, value)

Removes the last occurrence of value from target array. If the value is not found, returns the original array unchanged.

Example

ts
import { Array } from "@monstermann/array";

Array.removeLast([1, 2, 3, 2], 2); // [1, 2, 3]
ts
import { Array } from "@monstermann/array";

pipe([1, 2, 3, 2], Array.removeLast(2)); // [1, 2, 3]