A modern way to access the last element of an array

The shortest code to access the last array item.

Sometimes I have to access the last element in an array.

The most typical case is when I need to visualize series of different kinds of overlapping events as time spans. To convert a series into a span I have to determine the times of the first and last event in a series. For that I sort the array…