Skip to content
Legacy docs for Tenzir v5.x. For the latest Tenzir v6 series, visit docs.tenzir.com. Migrating from v5? Read the Tenzir v6 migration guide.

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]}

Last updated: