Implementation
D

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
x := items[len(items)-1]
var x = items[items.length - 1];
x = items.last
x = items[-1]
x = items[-1]
x := items[high(items)];
val x = items.takeRight(1)
foo :: [a] -> Maybe a
foo [] = Nothing
foo xs = Just $ last xs

x = foo items
int[42] items;
int x = items[$-1];
x = items.last;
local x = items[#items]
let x = items[items.len()-1];
my $x = $items[-1];
$x = end($items);
let x = items.last().unwrap();
var x = items[items.Count - 1];
x = List.last(items)
int x = items[items.length - 1];
x = lists:last(items),