Skip to content

unctionjs/dropLast

Repository files navigation

@unction/dropLast

Tests Stability Dependencies

number => OrderedArray | Set | Record<string | number | symbol, B> | Map<B, A> | string => OrderedArray | Set | Record<string | number | symbol, B> | Map<B, A> | string

Returns all but the last N of a list of ordered values.

dropLast(2)([1, 2, 3]) // [1]
dropLast(1)([1, 2, 3]) // [1, 2]
dropLast(2)("abc") // "a"
dropLast(1)("abc") // "ab"