AssociationQ

AssociationQ[expr]

gives True if expr is a valid Association object, and False otherwise.

Examples

Basic Examples  (2)

Association constructed from rules yields a valid object:

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

Valid Association object allows extraction of values given keys:

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

If arguments are not rules, Association remains unevaluated:

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

Association that is not valid has no special properties:

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

See Also

Association  Normal  Head

Introduced in 2015
(10.1)