return the last item in an array of objects code example
Example 1: javascript get last element in an array
var last = arr[arr.length - 1]
Example 2: get last element of array javascript
if (loc_array[loc_array.length - 1] === 'index.html') {
// do something
} else {
// something else
}