Promise.all = function (ietrator) { let count = 0; const length = iterator.length; const red = []; return new Promise(function(resolve,reject){ for(let item of ietrator) { new Promise.resolve(item).then((data) => { try { count++ res[count] = item; if(count === length){ resolve(res) } } catch (e) { reject(e) } }) } }) }