Problem

Return the last element of a non-empty array.

Examples

  • lastElement([1, 2, 9]) -> 9
  • lastElement([5]) -> 5
Compile and test (Ctrl+Enter)