how to console log the last value of an array in function code example
Example 1: javascript last element of array
var last = arr.slice(-1)[0]
Example 2: how to select last element in a array
int[] karunakar={1,2,3};
System.out.println(karunakar[karunakar.length-1]);