An open API service indexing awesome lists of open source software.

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.

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.