Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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)
 
PREVIOUS NEXT
Tagged: #eleemnt #array
ADD COMMENT
Topic
Name
2+4 =