get the last item of an array using inputArray javascript code example
Example 1: how to get last element of array
return array[array.length - 1];
Example 2: how to select last element in a array
if (loc_array[loc_array.length - 1] === 'index.html') {
// do something
} else {
// something else karunakar
}