PrependTo

PrependTo[s,elem]

prepends elem to the value of s, and resets s to the result.

Details

Examples

open allclose all

Basic Examples  (2)

Assign l to a list:

In[1]:=
Click for copyable input
Out[1]=

Include a new value at the beginning of the list:

In[2]:=
Click for copyable input
Out[2]=

The value assigned to l has changed:

In[3]:=
Click for copyable input
Out[3]=

Prepend to an Association:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Generalizations & Extensions  (2)

Applications  (1)

Possible Issues  (4)

See Also

AppendTo  AssociateTo  Sow  AddTo  Prepend

Tutorials

Introduced in 1988
(1.0)
| Updated in 2014
(10.0)