how to retrieve the last value of an array javascript code example
Example 1: get last element of array javascript
let colors = ["red", "yellow", "green"];
let lastELement = colors[colors.length - 1]
Example 2: how to select last element in a array
int[] karunakar={1,2,3};
System.out.println(karunakar[karunakar.length-1]);