Problem

Return new array with val appended.

Examples

  • listAddEnd([1, 2], 3) -> [1, 2, 3]
  • listAddEnd([], 7) -> [7]
Compile and test (Ctrl+Enter)