very good solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```javascript []\n/**\n * @param {Array<Function>} functions\n * @return {Promise<any>}\n */\nvar promiseAll = function(functions) {\n\n\n    // const promises = functions.map(fn => fn());  // mappin all arugements into the function here so that\n    // // they can get executed here \n    // return Promise.all(promises);\n\n    // but this is not the right solution \n\n    return new Promise((resolve,reject) => {\n        let res = Array(functions.length); // this to store the values\n        let wating = functions.length;\n        // so now executing the all function \n        for(let i = 0; i < functions.length; i++){\n            functions[i]().then((result) =>{\n                res[i] = result; // as it resolve so value stored \n                wating--; // as we have to check for the all in prallel so for that \n                if(wating == 0){\n                    resolve(res) // so this will be called at the last \n                }\n            }).catch(reject);\n        }\n    }) // always take looks at bracket of it \n\n};\n\n/**\n * const promise = promiseAll([() => new Promise(res => res(42))])\n * promise.then(console.log); // [42]\n */\n```
['JavaScript']