Skip to content

Clear

Clear[sym1, sym2, ...] clears the symbol definitions from the evaluation context.

Attributes[Clear] := {HoldAll, Protected}

Simple examples

In[1]:= a
Out[1]= a
In[2]:= a = 5
Out[2]= 5
In[3]:= b = 6
Out[3]= 6
In[4]:= c = 7
Out[4]= 7
In[5]:= a
Out[5]= 5
In[6]:= Clear[a, 99, b]
Out[6]= Null
In[7]:= Head[a]
Out[7]= Symbol
In[8]:= Head[b]
Out[8]= Symbol
In[9]:= Head[c]
Out[9]= Integer
In[10]:= Clear[c]
Out[10]= Null
In[11]:= Head[c]
Out[11]= Symbol