Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get the last eleemnt of an array

var Cars = ["Volvo", "Mazda", "Lamborghini", "Maserati"];
//We can get the total number of elements like this.
var hmCars = Cars.pop();
//hmCars is now Maserati
console.log(hmCars)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #eleemnt #array
ADD COMMENT
Topic
Name
8+8 =