Answers for "java script get last element of aaray"

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 "java script get last element of aaray"

Code answers related to "Javascript"

Browse Popular Code Answers by Language