Ruby Array en dernier

a = [1, 2, 3, 4, 5]
a.last # => 5
a[-1]  # => 5
Aleksandr Korepanov