access to last item of array code example Example: javascript get the last array element const myArray = [1, 2, 3] console.log(myArray.item(-1)) //=> 3