length-1
Version:
First negative index through Array
19 lines (15 loc) • 521 B
Markdown
# length-1 [](http://travis-ci.org/WebReflection/length-1) [](https://badge.fury.io/js/length-1)
First negative index through Array
```js
var getLengthMinus1 = require('./length-1');
// Arrays fixed
var arr = [1, 2, 3];
arr[-1]; // 3
// reusable tested functionality
Object.defineProperty(
NodeList.prototype,
-1,
{get: getLengthMinus1}
);
document.querySelectorAll('#menu li')[-1];
```