ClojureDocs

Nav

Namespaces

map-indexed

clojure.core

Available since 1.2 (source)
  • (map-indexed f)
  • (map-indexed f coll)
Returns a lazy sequence consisting of the result of applying f to 0
and the first item of coll, followed by applying f to 1 and the second
item in coll, etc, until coll is exhausted. Thus function f should
accept 2 arguments, index and item. Returns a stateful transducer when
no collection is provided.