How do I find the last value in an array? code example
Example 1: get last element of array javascript
var numbers = ["one", "two", "three"];
var lastnumber = numbers[numbers.length - 1];
console.log(lastnumber);
Example 2: last element of an array
int[] array = {1,2,3};
System.out.println(array[array.length - 1]);