display last elements of array with map method javascipt 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