ArrayNodeIterator

typesince v1.7.28Edit
(ArrayNodeIterator. arr i next-iter)

Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(deftype ArrayNodeIterator [arr ^:mutable i ^:mutable next-iter]
  Object
  (hasNext [this]
    (let [len (alength arr)]
      (loop []
        (if-not (and  (some? next-iter) ^boolean (.hasNext next-iter))
          (if (< i len)
            (let [node (aget arr i)]
              (set! i (inc i))
              (when (some? node)
                (set! next-iter (-iterator node)))
              (recur))
            false)
          true))))
  (next [this]
    (if ^boolean (.hasNext this)
      (.next next-iter)
      (throw (js/Error. "No such element"))))
  (remove [_] (js/Error. "Unsupported operation")))