js last element of a list code example
Example 1: last element of an array javascript
var myArray = [1, 2, 3, 4];
myArray[myArray.length - 1];
Example 2: javascript last element of an array
var colors = ["red","blue","green"];
var green = colors[colors.length - 1];//get last