(make-array size)
(make-array type size)
(make-array type size & more-sizes)
Construct a JavaScript array of the specified dimensions. Accepts ignored
type argument for compatibility with Clojure. Note that there is no efficient
way to allocate multi-dimensional arrays in JavaScript; as such, this function
will run in polynomial time when called with 3 or more arguments.
Source
(defn
make-array
"Construct a JavaScript array of the specified dimensions. Accepts ignored\n type argument for compatibility with Clojure. Note that there is no efficient\n way to allocate multi-dimensional arrays in JavaScript; as such, this function\n will run in polynomial time when called with 3 or more arguments."
([size] (js/Array. size))
([type size] (make-array size))
([type size & more-sizes]
(let
[dims more-sizes dimarray (make-array size)]
(dotimes
[i (alength dimarray)]
(aset dimarray i (apply make-array nil dims)))
dimarray)))