title: How do I make this async foreach loop work with promises?
body: <p>I've already messed around with Promises in it, but I'm new to them and I just can't figure out how to do it properly. At the moment, there's no point to the Promise, because it doesn't wait till the async <code>$.get</code> completes.</p>
  
  <p>Basically, each <code>foreach</code> iteration has its own <code>$.get</code> function, and I need to have them all complete and then continue to the part that has the "...gets albumart" <code>console.log</code>.</p>
  
  <pre><code>$.get(id,function(data) {
      //(there's some code here)
      var getZippyUrls = new Promise(function(resolve) {
              zippyarray.forEach(function(zippy) {
              //(more code)
              $.get(zippy.full, function(data) {
                  //^This is the foreach of $.gets
                 //(code's here)
              });  
             resolve(zippyarray);
          });
      });
  
      //This is my failed Promise -&gt;
      getZippyUrls.then(function(response) {
          console.log("WE'RE OUT " + response.length);
          response.foreach(function(d) {
              console.log("Promise"+d.media);
          });
          console.log('eyyyyyy');
      });
  
      console.log("...gets albumart");
      //Now after the previous stuff is done, move on
  </code></pre>