Answers for "getting to the last element oof the aarray"

2

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)
Posted by: Guest on November-28-2020

Code answers related to "getting to the last element oof the aarray"

Code answers related to "Javascript"

Browse Popular Code Answers by Language