array get last item esnext code example
Example: javascript last element of an array
var colors = ["red","blue","green"];
var green = colors[colors.length - 1];//get last
var colors = ["red","blue","green"];
var green = colors[colors.length - 1];//get last