1var foods = ["kiwi","apple","banana"];
2var banana = foods[foods.length - 1]; // Getting last element
1var colors = ["red","blue","green"];
2var green = colors[colors.length - 1];//get last item in the array
1const heroes = ["Batman", "Superman", "Hulk"];
2const lastHero = heroes.pop(); // Returns last elment of the Array
3// lastHero = "Hulk"
1var colors = ["red","blue","green"];
2var green = colors[colors.length - 1]; //get last item in the array
1var colors = ["black", "white", "red", "yellow"];
2var yellow = colors[colors.length - 1];