UNPKG
ts-prime
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
0.3.15
0.3.14
0.3.13
0.3.12
0.3.11
0.3.10
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.0
0.1.0
0.0.28
0.0.27
0.0.26
0.0.25
0.0.24
0.0.23
0.0.22
0.0.21
0.0.20
A utility library for JavaScript and Typescript.
digimuza.github.io/ts-prime
digimuza/ts-prime
ts-prime
/
dist
/
es
/
dropLast.test.js
10 lines
(9 loc)
•
292 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
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); });