ClojureDocs

Nav

Namespaces

Take the 2025 State of Clojure Survey! Help shape the future of Clojure. Take Survey →

contains?

clojure.core

Available since 1.0 (source)
  • (contains? coll key)
Returns true if key is present in the given collection, otherwise
returns false.  Note that for numerically indexed collections like
vectors and Java arrays, this tests if the numeric key is within the
range of indexes. 'contains?' operates constant or logarithmic time;
it will not perform a linear search for a value.  See also 'some'.