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
/
length-1.js
12 lines
(11 loc)
•
200 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
Object
.
defineProperty
(
Array
.
prototype
, -
1
, {
configurable
:
true
,
get
: (
module
.
exports
=
function
get
(
) {
var
l =
this
.
length
;
return
l ?
this
[l -
1
] :
void
0
; }) } );