how to return last value of array code example
Example 1: get last item in array javascript
var colors = ["red","blue","green"];
var green = colors[colors.length - 1]; //get last item in the array
Example 2: how to find last element in array
int [] y={1,2,3,4,5};
int c=(n.length-1);