prepend
Inserts an element at the start of a list.
Description
The prepend
function returns the list xs
with x
inserted at the front.
The expression xs.prepend(y)
is equivalent to [x, ...xs]
.
Examples
Prepend a number to a list
See Also
append
, concatenate