A very questionable challenge description
IntuitionApproachIt took me a long time to understand that I should wrap everything into Promise and resolve/reject it based on my needs. Let's call it a Wrappe
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
It took me a long time to understand that I should wrap everything into Promise and resolve/reject it based on my needs. Let's call it a WrapperPromise

In a cycle I extract the promises from functions
I Leave a catch and reject the WrapperPromise immediately once we bump into an error

In a separate cycle, I await for all promises to be resolved, and push this result into array.

resolve a WrapperPromise with results array

# What was bad
- The description that telling me that something should be done in "parallel", when I clearly know that this is not a thing in JS, and promises are executed SEQUENTUALLY in the micro task queue. 


# Code
```javascript []
/**
 * @param {Array<Function>} functions
 * @return {Promise<any>}
 */
var promiseAll = async function (functions) {
    return new Promise(async (resolve, reject) => {
        const results = [];
        const wrappedPromises = functions.map((func) => {
            return func()
            .catch((err) => reject('Error'))
        })

        for(const result of wrappedPromises) {
            const awaitedResult = await result
            results.push(awaitedResult)
        }
        resolve(results)
    })
};

/**
 * const promise = promiseAll([() => new Promise(res => res(42))])
 * promise.then(console.log); // [42]
 */
```
['JavaScript']