Skip to content

prepend

Inserts an element at the start of a list.

prepend(xs:list, x:any) -> list

The prepend function returns the list xs with x inserted at the front. The expression xs.prepend(y) is equivalent to [x, ...xs].

from {xs: [1, 2]}
xs = xs.prepend(3)
{xs: [3, 1, 2]}

append, concatenate