var heroes = ["Batman", "Superman", "Hulk"]; var lastHero = heroes.pop(); // Returns last elment of the Array // lastHero = "Hulk"
const numArray = [1,2,3,4,5]; const lastNumber = numArray.reverse()[0];
if (loc_array[loc_array.length - 1] === 'index.html') { // do something } else { // something else }
var a = loc_array.slice(-1)[0]