WLJS LogoWLJS Notebook

PrependTo

PrependTo[x,elem] prepends elem to the value of x, and resets x to the result.

Examples

Prepend an element to a list:

x = {2, 3, 4};
PrependTo[x, 1];
x
(* {1, 2, 3, 4} *)

Please visit the official Wolfram Language Reference for more details.

On this page