(conj-unique coll x)
(element-of pred coll)
finds the element within an array
(element-of keyword? [1 2 :hello 4]) => :hello
finds the element within an array (element-of keyword? [1 2 :hello 4]) => :hello
(flatten-all x)
flattens all elements the collection
(flatten-all [1 2 #{3 {4 5}}]) => [1 2 3 4 5]
flattens all elements the collection (flatten-all [1 2 #{3 {4 5}}]) => [1 2 3 4 5]
(index-of pred coll)
finds the index of the first matching element in an array
(index-of even? [1 2 3 4]) => 1
(index-of keyword? [1 2 :hello 4]) => 2
finds the index of the first matching element in an array (index-of even? [1 2 3 4]) => 1 (index-of keyword? [1 2 :hello 4]) => 2
(positions pred coll)
find positions of elements matching the predicate
(positions even? [5 5 4 4 3 3 2 2]) => [2 3 6 7]
find positions of elements matching the predicate (positions even? [5 5 4 4 3 3 2 2]) => [2 3 6 7]
(remove-index coll i)
removes element at the specified index
(remove-index [:a :b :c :d] 2) => [:a :b :d]
removes element at the specified index (remove-index [:a :b :c :d] 2) => [:a :b :d]
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close