Use the .length property to find the last element of an array. code example
Example: last item in array javascript
// Find the last item in an array.
arrayName[arrayName.length - 1]
// Find the last item in an array.
arrayName[arrayName.length - 1]