1.0.0 • Published 4 years ago
last-item-index
Get the index of the last item in an array.
Install
npm install last-item-index
Usage
const lastItemIndex = require("last-item-index")
lastItemIndex([1, 2, 3]);
//=> 2
lastItemIndex([]);
//=> undefined
API
lastItemIndex(array)
array
Type: array
The array to get the index for.