listPrepend (Function)

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

Description: Returns a new list with value at the front. O(n).

Parameters

  • list (List): The list
  • value (t0): Value to prepend

Returns: List

Example

listPrepend([2, 3], 1)  // [1, 2, 3]
listPrepend ([2, 3], 1)  // [1, 2, 3]