title: ColdFusion: Is it possible to get the index from a cfscript for in loop?
body: <p>So I'm iterating through an array of structs using a for in loop</p>
  
  <pre><code>for(item in array) {
      processStruct(item)
  }
  </code></pre>
  
  <p>Pretty straightforward, What I'm trying to do is get the current index in the for in loop and pass it along as well to the function: <code>processStruct(item, index)</code>. I know I can do this with a regular for loop and it's also possible with the tag version <code>&lt;cfloop&gt;</code></p>
  
  <pre><code>&lt;cfloop array="#myArray#" index="i"&gt;
      #i#
  &lt;cfloop&gt;
  </code></pre>