title: collection.map is not a function at Promise.all.then
body: <p>Alright, guys</p>
  
  <p>I'm new to <code>promises</code> and am trying to map the result of loading in CSVs via <code>promises</code>, to then perform subsequent applications on it. Is Async mapping allowed? Is there an alternative approach to map after using <code>promises</code>? Or am I being stupid and missing something completely simple?</p>
  
  <pre><code>var csv = (url) =&gt; new Promise(function(resolve) {
      d3.csv(url, function(data) {
          data.forEach(function(d) { 
              d.String = d.String;
              d.Integer = +d.Integer;
          })
      resolve(data);
      });
  });
  
  Promise.all([ 
      csv('content.csv'),
      csv('moreContent.csv')
  ])
  .then(([csvOne, csvTwo]) =&gt; { 
      var collection = { csvOne, csvTwo };
  
      var aveageMap = {};
  
      collection.map((d,i) =&gt; {
          if (!aveageMap[d.String]) {
              aveageMap[d.String] = {
                  sum: 0,
                  average: 0
              };
          }
          var theWord = aveMap[d.String];
          theWord.sum += +d.Integer;
          theWord.average = theWord.sum / collection.length;
      });
  
      console.log(aveageMap);
  
  });
  </code></pre>
  
  <p><strong><em>For the comments and answers below</em></strong></p>
  
  <p>Using an array <strong>is</strong> an object, but returns a complete merger of the two CSVs... Which affects the <code>theWord.sum / collection.length</code> line... Whilst it works to some degree, I wanted to use an array of objects so that I could get an output like the one below, and access each object independently if needed.</p>
  
  <pre><code>collection {
      dataCSV {
          String: , Integer: ,
          String: , Integer: ,
      },
      dataCSV2 {
          String: , Integer: ,
          String: , Integer: ,
      }
  }
  </code></pre>