javascript get the last element in an array code example Example: javascipt get last element of array const arr = [1,2,3] ; console.log(arr[arr.length - 1]);