JSFiddle - React, Tailwind, and code Playground

by fastfasterfastest

JavaScript

var obj = { },
   deferred = $.Deferred(),
   promise = deferred.promise( obj );

   //promise of a promise should be the promise itself
   alert( "the promise of the promise " + (promise.promise() === promise ? "is" : "is NOT") + " the promise itself" );

   promise.done(function(){
      //context should be the promise
      alert( "the context of the done method " + (this === promise ? "is" : "is NOT") + " the promise" );
   });

   deferred.resolve();