Answers for "how to get the last 6 elements of the array"

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 "how to get the last 6 elements of the array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language