1const heroes = ["Batman", "Superman", "Hulk"];
2const lastHero = heroes.pop(); // Returns last elment of the Array
3// lastHero = "Hulk"
1let array = [1,2,3,4,5];
2let lastElement = array.pop();
3
4// array -> [1,2,3,4];
5// lastElement = 5;
1f (loc_array[loc_array.length - 1] === 'index.html') {
2 // do something
3} else {
4 // something else
5}