Get last element from JavaScript array

arr[arr.length - 1]