WLJS LogoWLJS Notebook

Insert

Insert[list, elem, n] inserts elem at position n in list.

Examples

Insert at position 2:

Insert[{a, b, c}, x, 2]
(* {a, x, b, c} *)

Insert from the end:

Insert[{a, b, c}, x, -1]
(* {a, b, c, x} *)

Please visit the official Wolfram Language Reference for more details.

On this page