javascript last ele in arr code example
Example 1: javascript last element of an array
var colors = ["red","blue","green"];
var green = colors[colors.length - 1];//get last
Example 2: last item in array javascript
// Find the last item in an array.
arrayName[arrayName.length - 1]