title: How to check for last item when looping through a structure in ColdFusion?
body: <p>I want to loop over a structure and output something for all items except the last one. For arrays this can easily be done by checking whether the current index is the last one, though how to do it for structures?</p>
  
  <p>Example code:</p>
  
  <pre><code>&lt;cfscript&gt;
  myStruct = {
    item1 = "foo",
    item2 = "bar",
    item3 = "baz"
  };
  &lt;/cfscript&gt;
  
  &lt;cfoutput&gt;
  &lt;cfloop collection="#myStruct#" item="item"&gt;
    #myStruct[item]#
    &lt;!--- Here should be the conditional output ---&gt;
  &lt;/cfloop&gt;
  &lt;/cfoutput&gt;
  </code></pre>