Answers for "how to read the last value in an array javascript"

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 "how to read the last value in an array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language