find last value of array code example
Example 1: how to get last element of array
return array[array.length - 1];
Example 2: get last item in array javascript
var colors = ["black", "white", "red", "yellow"];
var yellow = colors[colors.length - 1];