PersistentHashMap.fromArray

functionsince v0.0-2719Edit
(PersistentHashMap.fromArray arr no-clone)

Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(set! (.-fromArray PersistentHashMap)
  (fn [arr ^boolean no-clone]
    (let [arr (if no-clone arr (aclone arr))
          len (alength arr)]
      (loop [i 0 ret (transient (.-EMPTY PersistentHashMap))]
        (if (< i len)
          (recur (+ i 2)
            (-assoc! ret (aget arr i) (aget arr (inc i))))
          (-persistent! ret))))))