1var colors = ["red","blue","green"];
2var green = colors[colors.length - 1];//get last item in the array
1var my_array = /* some array here */;
2var last_element = my_array[my_array.length - 1];
1var colors = ["red","blue","green"];
2var green = colors[colors.length - 1];//get last
1var heroes = ["Batman", "Superman", "Hulk"];
2var lastHero = heroes.pop(); // Returns last elment of the Array
3// lastHero = "Hulk"