View Problem

Fetch the last element of a list

Given the list [Red, Green, Blue], access the last element ('Blue')
ExpandDiskEdit
fantom
["Red", "Green", "Blue"][-1]
ExpandDiskEdit
fantom
["One", "Two", "Three", "Four", "Five"].last
ExpandDiskEdit
erlang
Result = lists:last(List),
ExpandDiskEdit
erlang
Result = last(List),
ExpandDiskEdit
erlang
Result = hd(lists:reverse(List)),
ExpandDiskEdit
erlang
Result = lists:nth(length(List), List),

Submit a new solution for fantom or erlang
There are 25 other solutions in additional languages (clojure, cpp, csharp, fsharp ...)