javascript find last object in array site:stackoverflow.com code example
Example 1: javascript get last element of array
var array = [1,2,3,4,5,6];
var val = array[array.length - 1]; // 6
Example 2: how to select last element in a array
int[] karunakar={1,2,3};
System.out.println(karunakar[karunakar.length-1]);