return array[array.length - 1];
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)
var arr = [1,2,3] var lastelementofarr = [arr.length-1] //I think it will return the last element in the array
int[] array = {1,2,3}; System.out.println(array[array.length - 1]);
//the last one