understanding usage of deffered.promise in jquery animation

understanding usage of deffered.promise in jquery animation

hey guys have a look at this code below , 


Code here ::

  1. $("button").on("click", function () {
  2.     $("p").append("Started...");

  3.     $("div").each(function (i) {
  4.         $(this).fadeIn().fadeOut(1000 * (i + 1));
  5.     });

  6.     $("div").promise().done(function () {
  7.         $("p").append(" Finished! ");
  8.     });
  9. });
now what is promise() even doing in this code ? . 

aso another question i woudl like to ask is , is  Deferred, Promise and Future a Javascript thing ? or is it all only exclusively available in jQuery ? 

Thank you. 

Gautam.