last-item-index
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

last-item-index Travis CI Build Status

Get the index of the last item in an array.

NPM Badge

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.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i last-item-index

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    2.99 kB

    Total Files

    6

    Last publish

    Collaborators

    • richienb