Get the last element of an array