Easy TypeScript solution
Code\n\nasync function promiseAll<T>(functions: (() => Promise<T>)[]): Promise<T[]> {\n  return new Promise((resolve, reject) => {\n    const result = new Array
# Code\n```\nasync function promiseAll<T>(functions: (() => Promise<T>)[]): Promise<T[]> {\n  return new Promise((resolve, reject) => {\n    const result = new Array(functions.length);\n    let count = functions.length;\n\n    for (let index = 0; index < functions.length; index++) {\n      const func = functions[index];\n      func()\n        .then((value) => {\n          result[index] = value;\n          count--;\n\n          if (count === 0) return resolve(result);\n        })\n        .catch(reject);\n    }\n  })\n};\n```
['TypeScript']