BUILT-IN WOLFRAM LANGUAGE SYMBOL

KeyExistsQ

KeyExistsQ[assoc,key]
returns True if the specified key exists in the association assoc, and False otherwise.

KeyExistsQ[key]
represents an operator form of KeyExistsQ that can be applied to an expression.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Test if a key exists in an association:

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

Test if a key exists in a list of rules:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Introduced in 2014
(10.0)