understanding usage of deffered.promise in jquery animation
hey guys have a look at this code below ,
Code here ::
- $("button").on("click", function () {
- $("p").append("Started...");
-
- $("div").each(function (i) {
- $(this).fadeIn().fadeOut(1000 * (i + 1));
- });
-
- $("div").promise().done(function () {
- $("p").append(" Finished! ");
- });
- });
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.