A little reminder from Matt Smith that getting the last item in an Array is easier now:
const fruits = ["apple", "banana", "cherry"];
/* newer, easier */
console.log(fruits.at(-1));
/* older, harder */
console.log(fruits[fruits.length - 1]);
Code language: JavaScript (javascript)