Typescript | Easy to understand
Code\n\nasync function promiseAll<T>(functions: (() => Promise<T>)[]): Promise<T[]> {\n    return new Promise((resolve,reject)=>{\n        var results:any = []\
# Code\n```\nasync function promiseAll<T>(functions: (() => Promise<T>)[]): Promise<T[]> {\n    return new Promise((resolve,reject)=>{\n        var results:any = []\n        var promiseResolved:number = 0;\n\n        for(let i=0;i<functions.length;i++){\n            functions[i]()\n            .then((result)=>{\n                results[i] = result;\n                promiseResolved++;\n                if(promiseResolved === functions.length) resolve(results)\n            })\n            .catch((error)=>{\n                reject(error);\n            })\n        }\n    });\n};\n```
['TypeScript']