title: For Loop over Backbone Collection
body: <p>Fairly new to backbone, so this is a really basic question. I have a Backbone collection passed into a function and I can prove that it has been passed and that the models in the collection have ids.</p>
  
  <p>Here's how I'm setting the ids - </p>
  
  <pre><code>convertToMapObjects: (results)  =&gt;
     objectList = new ObjectList()
     results.each(result)-&gt;
      testObj = new TestObject()
      testObj.set
        id = result.get("id")
      objectList.add(testObj)
  </code></pre>
  
  <p>And in another function ( accessed through making the model trigger an event) -</p>
  
  <pre><code>getIds: (objects) =&gt;
  ids = (object.id for object in objects) 
  </code></pre>
  
  <p>I think the issue may be because of how I'm iterating through the collection because when I tried doing</p>
  
  <pre><code>for object in objects
     console.log(object)
  </code></pre>
  
  <p>I saw two undefineds. Is this correct? If so, why can't I use a for loop to go through a backbone collection? Also, is there a way I could do so? </p>