listAppend (Function)

Signature: listAppend(list: List<t0>, value: t0) -> List<t0>

Description: Returns a new list with value at the end. Amortized O(1).

Parameters

  • list (List<t0>): The list
  • value (t0): Value to append

Returns: List<t0>

Example

let appended = listAppend([1, 2], 3)  // [1, 2, 3]
appended = listAppend ([1, 2], 3)  // [1, 2, 3]