1.0.2 • Published 2 years ago
last-method v1.0.2
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