last-method

1.0.2 • Public • Published

last-method

Adds a last method to all arrays. Will return -1 if the array is empty.

Install

npm i last-method

Examples

import 'last-method'

const array = [1, 2, 3, 4, 5]
array.last() // 5

const emptyArray = []
emptyArray.last() // -1

Package Sidebar

Install

npm i last-method

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

2.7 kB

Total Files

6

Last publish

Collaborators

  • r00ks