title: Backbone.js: Build JSON array from collection
body: <p>I have a backbone collection <code>Platforms</code>.  The structure of <code>Platforms</code> looks like this:</p>
  
  <pre><code>Platforms
    PlatformList
      models
        0: Platform
          attributes
            id: 1
            name: "some name"
        1: Platform
          attributes
            id: 2
            name: "some other name"
  </code></pre>
  
  <p>I need to extract the attributes from the models within the collection, and build a JSON array in the following format:</p>
  
  <pre><code>[{"id":1,"name":"some name"},{"id":2,"name":"some other name"}]
  </code></pre>
  
  <p>Calling <code>Platforms.models.toJSON()</code> or <code>JSON.stringify(Platforms.models)</code> results in a literal string <code>"[[object Object], [object Object]]"</code></p>
  
  <p>How can I build the JSON array that I need from this collection?</p>