const arr = [1,2,3,4,5]
1:const [lastItem] = arr.slice(-1)
console.log(lastItem)
2:const len = arr.length
console.log(arr[len-1])
3: const lastItem = arr.pop()
4:const {length,last:length-1} = arr
cosole.log(arr[last])
5: const [lastItem,...rest] = [...arr].reverse()
console.log(lastItem)