function | since v0.0-1211 | clojure.core/to-array-2d | Edit |
(to-array-2d coll)
Returns a (potentially-ragged) 2-dimensional JavaScript array containing the
contents of coll
.
Returns a (potentially-ragged) 2-dimensional array containing the contents of coll.
(defn to-array-2d
[coll]
(let [ret (make-array (count coll))]
(loop [i 0 xs (seq coll)]
(when-not (nil? xs)
(aset ret i (to-array (first xs)))
(recur (inc i) (next xs))))
ret))