JSFiddle - React, Tailwind, and code Playground

JavaScript

(function( win ,doc, $ ) {
    var count    = 8,
        promises = [ ],
        // moar magic required here...
        when     = Function.prototype.apply.bind( $.when , null);

    function createDef( num ) {
        return $.Deferred(function( promise ) {
            win.setTimeout(function() {
                console.log( num, ': fullfilled' );
                promise.resolve( num );
            }, ~~(Math.random() * 4000));
        }).promise();
    }    
    
    while( count-- ) {
        promises.push( createDef( count ) );
    }

    // ... to get rid of that null
    when( promises ).done(function() {
        console.log( 'ALL PROMISES FULLFILLED!' );
    });
}( this, this.document, jQuery ));