AppendTo

AppendTo[s,elem]
appends elem to the value of s, and resets s to the result.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Assign to a list:

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

Include a new value at the end of the list:

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

The value assigned to has changed:

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

Append 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]=
Introduced in 1988
(1.0)
| Updated in 2014
(10.0)
Translate this page: