Problem

Return true if the first and last elements of the array are equal.

Examples

  • sameFirstLast([5, 3, 8]) -> false
  • sameFirstLast([4, 9, 4]) -> true
  • sameFirstLast([12]) -> true
Compile and test (Ctrl+Enter)