Последний индексный массив JavaScript
var colors = ["red","blue","green"];
var green = colors[colors.length - 1]; //get last item in the array
Grepper
var colors = ["red","blue","green"];
var green = colors[colors.length - 1]; //get last item in the array
var items: String[] = ["tom", "jeff", "sam"];
alert(items[items.length-1])