UNPKG

ts-prime

Version:

A utility library for JavaScript and Typescript.

10 lines (9 loc) 292 B
import { dropLast } from './dropLast'; var arr = [1, 2, 3, 4, 5]; test('should drop last', function () { expect(dropLast(arr, 2)).toEqual([1, 2, 3]); }); test('should not drop last', function () { expect(dropLast(arr, 0)).toEqual(arr); expect(dropLast(arr, -0)).toEqual(arr); });