ClojureDocs

导航

命名空间

contains?

clojure.core

自 1.0 起提供 (源代码)
  • (contains? 集合 键)
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'.