Given a non-empty array array, return the last element of this array.
array
lastElement([7,4,2]) // 2 lastElement([1]) // 1