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