function | since v0.0-927 | Edit |
(prim-seq prim)
(prim-seq prim i)
Creates a seq
from a JavaScript array or array-like object.
(prim-seq #js [1 2 3])
;;=> (1 2 3)
Also works on Array-like objects, like NodeList.
(prim-seq (js/document.querySelectorAll "div"))
;;=> ...
Create seq from a primitive JavaScript Array-like.
(defn prim-seq
([prim]
(prim-seq prim 0))
([prim i]
(when (< i (alength prim))
(IndexedSeq. prim i nil))))