Answers for "fiding last element in array"

5

find last element in array javascript

var heroes = ["Batman", "Superman", "Hulk"];
var lastHero = heroes.pop(); // Returns last elment of the Array
// lastHero = "Hulk"
Posted by: Guest on June-11-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language