function | since v0.0-1211 | Edit |
(PersistentHashMap.fromArrays ks vs)
(set! (.-fromArrays PersistentHashMap)
(fn [ks vs]
(let [len (alength ks)]
(loop [i 0 ^not-native out (transient (.-EMPTY PersistentHashMap))]
(if (< i len)
(if (<= (alength vs) i)
(throw (js/Error. (str "No value supplied for key: " (aget ks i))))
(recur (inc i) (-assoc! out (aget ks i) (aget vs i))))
(persistent! out))))))