title: Why and how should the promise() method be used?
body: <p>Consider the code snippet below. What will be the difference between the start and end times displayed? Why is the <code>.promise().done()</code> not responding? </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function getMinsSecs() {
    var dt = new Date();
    return dt.getMinutes() + ":" + dt.getSeconds();
  }
  
  $("#start").on("click", function() {
    $("p").append("Start time: " + getMinsSecs() + "&lt;br /&gt;");
    
    $("div").each(function(i) {
      $(this).fadeOut(1000 * (i * 2));
    });
    
    $("div").promise().done(function() {
      $("p").append("End time: " + getMinsSecs() + "&lt;br /&gt;");
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;button id="start"&gt;Start time&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>