PersistentHashMap.fromArrays

functionsince v0.0-1211Edit
(PersistentHashMap.fromArrays ks vs)

Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(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))))))