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