UNPKG
length-1
Version:
latest (1.0.1)
1.0.1
1.0.0
First negative index through Array
github.com/WebReflection/length-1
WebReflection/length-1
length-1
/
test.js
10 lines
(6 loc)
•
203 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
require
(
'./length-1'
);
var
r =
Math
.
random
();
var
a = [
1
,
2
, r];
var
b = [];
console
.
assert
(a[-
1
] === r,
'last value is the expected one'
);
console
.
assert
(b[-
1
] ===
void
0
,
'no max stack execution'
);