Simple JS Solution using async/await ✅
\n\n# Code\n\n/**\n * @param {Array<Function>} functions\n * @return {Promise<any>}\n */\nvar promiseAll = async function(functions) {\n    return new Promise((
\n\n# Code\n```\n/**\n * @param {Array<Function>} functions\n * @return {Promise<any>}\n */\nvar promiseAll = async function(functions) {\n    return new Promise((resolve,reject)=>{\n        if(functions.length === 0) {\n            resolve([]);\n            return;\n        }\n        const arr=new Array(functions.length);\n        arr.fill(null);\n        let count=0\n        functions.forEach(async(fn,i)=>{\n            try{\n                arr[i]=await fn()\n                count++\n            \n                if(count===functions.length){\n                    resolve(arr);\n                }\n            }\n            catch(e){\n                reject(e);\n            }\n        \n        });\n    });\n};\n\n/**\n * const promise = promiseAll([() => new Promise(res => res(42))])\n * promise.then(console.log); // [42]\n */\n```
['JavaScript']