js เอารายการสุดท้ายในอาเรย์
const heroes = ["Batman", "Superman", "Hulk"];
const lastHero = heroes.pop(); // Returns last elment of the Array
// lastHero = "Hulk"
จาวาสคริปต์สุดท้ายของธาตุอาเรย์
let arr = ['a', 'b', 'c']
arr.slice(-1)[0] // returns last element in an array