var deferreds = []; var p = new Promise(function(resolve, reject){ deferreds.push({resolve: resolve, reject: reject}); });