slice in jquery get the last vlue code example
Example 1: jquery last character in string
myString.slice(-1);
Example 2: get last item in array js
if (loc_array[loc_array.length - 1] === 'index.html') {
// do something
} else {
// something else
}