let arr = ['a', 'b', 'c'] arr.slice(-1)[0] // returns last element in an array
const arr = [1,2,3] ; console.log(arr[arr.length - 1]);