JavaScript Solution
\n\n/**\n * @param {Array<Function>} functions\n * @return {Promise<any>}\n */\nvar promiseAll = async function(functions) {\n    return new Promise((resolve,re
\n```\n/**\n * @param {Array<Function>} functions\n * @return {Promise<any>}\n */\nvar promiseAll = async function(functions) {\n    return new Promise((resolve,reject)=>{\n        let ans=[],j=functions.length;\n        functions.forEach((func,i)=>{\n            func().then((res)=>{\n                (ans[i]=res,--j===0 && resolve(ans))\n            })\n            .catch(reject)\n        })\n    })\n    \n};\n\n/**\n * const promise = promiseAll([() => new Promise(res => res(42))])\n * promise.then(console.log); // [42]\n */\n```
['JavaScript']