https://github.com/richienb/last-item
Get the last item in an array or other iterable.
https://github.com/richienb/last-item
Last synced: 4 months ago
JSON representation
Get the last item in an array or other iterable.
- Host: GitHub
- URL: https://github.com/richienb/last-item
- Owner: Richienb
- License: mit
- Created: 2020-05-14T12:18:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-10-26T10:49:25.000Z (about 4 years ago)
- Last Synced: 2025-04-11T11:14:18.805Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# last-item
Get the last item in an array or other iterable.
## Install
```sh
npm install last-item
```
## Usage
```js
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.