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

2.0.0 • Public • Published

last-item

Get the last item in an array or other iterable.

Install

npm install last-item

Usage

import lastItem from 'last-item';

lastItem([1, 2, 3]);
//=> 3

API

lastItem(iterable)

iterable

Type: iterable

The array or other iterable to get the last item for.

Package Sidebar

Install

npm i last-item

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

2.8 kB

Total Files

6

Last publish

Collaborators

  • richienb