title: Promise.all on array of promises with parameter
body: <p>How can I add an array of promises to <code>Promise.all</code> when a parameter is passed to each promise?</p>
  
  <p>For example;</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var config = {
    name: [
      function(val) {
        return new Promise(function(resolve, reject) {
          resolve('This is ok')
        })
      },
      function(val) {
        return new Promise(function(resolve, reject) {
          resolve('This is ok')
        })
      }
    ],
    gender: [
      function(val) {
        return new Promise(function(resolve, reject) {
          resolve('This is ok')
        })
      },
      function(val) {
        return new Promise(function(resolve, reject) {
          reject('This is NOT ok')
        })
      }
    ]
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I essentially want to to do <code>Promise.all(config[name], ...)</code>. This will actually take place within a loop so that I can iterate over a form object, passing each key to get an array of associated promises and passing the value to each promise.</p>
  
  <p><strong>EDIT</strong> <a href="https://jsfiddle.net/karlbateman/keqnrybq/" rel="noreferrer">Fiddle</a> which implements the accepted answer, for the curious.</p>