function | since v0.0-927 | clojure.core/vec | Edit |
(vec coll)
Creates a new vector containing the contents of coll
Creates a new vector containing the contents of coll. JavaScript arrays will be aliased and should not be modified.
(defn vec
[coll]
(cond
(map-entry? coll)
[(key coll) (val coll)]
(vector? coll)
(with-meta coll nil)
(array? coll)
(.fromArray PersistentVector coll true)
:else
(-persistent!
(reduce -conj!
(-as-transient (.-EMPTY PersistentVector))
coll))))