Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find last element in array javascript

var heroes = ["Batman", "Superman", "Hulk"];
var lastHero = heroes.pop(); // Returns last elment of the Array
// lastHero = "Hulk"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #element #array #javascript
ADD COMMENT
Topic
Name
1+4 =