title: How does promise.all work?
body: <p>I started diggin' in promises and found interesting Promise.all.</p>
  
  <p>It is stated in MDN that </p>
  
  <blockquote>
    <p>The Promise.all(iterable) method returns a promise that resolves when all of the promises in the iterable argument have resolved.</p>
  </blockquote>
  
  <p>Which basically means that set promises resolve after and if all promises in argument list have been resolved. I tried to implement it. I made simply promise ajax call.</p>
  
  <pre class="lang-js prettyprint-override"><code>var get = function(url) {
      return new Promise(function(resolve,reject) {
          var xhtml=new XMLHttpRequest();
  
          xhtml.open("GET",url);
          xhtml.responseType = 'blob';
          xhtml.onload = function() {
              if(xhtml.status==200){
                  resolve(xhtml.response);
              } else {
                  reject(Error("Error"+statusText));
              }
          }
          xhtml.send();
      });
  
  }
  
  get("one.jpg").then(function(response){
      var blob = window.URL.createObjectURL(response);
      var img = document.createElement("img");
  
      console.log("Success"+response);
  
      img.src = blob;
  
      document.body.appendChild(img);
  });
  </code></pre>
  
  <p>Which works fine. But after I tried to add Promise.all it threw an error.</p>
  
  <pre><code>Promise.all(get).then(function(response){alert("done")});
  </code></pre>
  
  <p>this as i said threw an error " Argument 1 of Promise.all can't be converted to a sequence." 
  So I assume i didn't get the meaning of promise.all.
  How does it work?</p>