title: loading images with a Promise.all
body: <p>I'm trying to use a Promise.all to load images,<br>
  but the status remain desperate for 'none'  </p>
  
  <pre class="lang-js prettyprint-override"><code>const images =
          { menu: { img:null , path:'images/Menu.png', status:'none' }
          , map : { img:null , path:'images/a6.png'  , status:'none' }
          };
  
  function loadImage( ref ) {
    return new Promise(function (resolve) {
  
      console.log( ref.path );
  
      ref.img = new Image();
  
      ref.img.onload  =_=&gt;{ ref.status='OK';  resolve() };
      ref.img.onerror =_=&gt;{ ref.status='bad'; resolve() };
  
      ref.img.src = ref.path;
    });
  }
  
  Promise
    .all([ loadImage(images.menu), loadImage(images.map) ])
    .then()
      {
      console.log('menu:', images.menu.status);
      console.log('map :', images.map.status);
      };
  </code></pre>
  
  <p>console:  </p>
  
  <blockquote>
    <p>images/Menu.png<br>
      images/a6.png<br>
      menu: none<br>
      map : none  </p>
  </blockquote>
  
  <p>what did I miss?  </p>
  
  <p>(JS-es6 only please)</p>