Skip to content

dropLast

dropLast(target, amount)

Removes amount of elements from the end of the target array.

ts
dropLast([1, 2, 3, 4, 5], 2); // [1, 2, 3]
ts
pipe([1, 2, 3, 4, 5], dropLast(2)); // [1, 2, 3]