how to print the last element of a list in javascript code example
Example 1: last element of an array
int[] array = {1,2,3};
System.out.println(array[array.length - 1]);
Example 2: get the last element of array javascript
if (loc_array[loc_array.length - 1] === 'index.html') {
// do something
} else {
// something else
}