title: jQuery each looping twice, why?
body: <p>I've got a script setup, the loop code is here as is the html structure</p>
  <p><a href="https://jsfiddle.net/OwenMelbz/mPVbE/" rel="nofollow noreferrer">https://jsfiddle.net/OwenMelbz/mPVbE/</a></p>
  <p>it basically searches the non-empty id's of the li and puts them into a csv string.</p>
  <p>however whenever i run it it always adds an extra loop in my non-fiddle version, so I have, 9 li's, 3 contain IDs, the loop runs 4 times. Why is this?</p>
  <p>In my non-dev version it actually picks the ID of the 1st li again and adds it. for example.</p>
  <pre><code>1,2,3,4,5,6,1
  </code></pre>
  <p>the 1 would be on the 1st element. no idea why this is doing it?</p>
  <p>thanks</p>