Skip to content

Head

Head[expr] returns the head of the expression.

Attributes[Head] := {Protected}

Simple examples

In[1]:= Head[f[x]]
Out[1]= f
In[2]:= Head[x]
Out[2]= Symbol
In[3]:= Head[{x}]
Out[3]= List
In[4]:= Head[a + b]
Out[4]= Plus
In[5]:= Head[1]
Out[5]= Integer
In[6]:= Head[1.]
Out[6]= Real
In[7]:= Head[(2)/(7)]
Out[7]= Rational
In[8]:= Head[(1)/(7)]
Out[8]= Rational
In[9]:= Head["1"]
Out[9]= String
In[10]:= Head[Head[a + b[x]]]
Out[10]= Plus