Microsoft interview question

Implement Promise.all function with a function that get an array of promises and returns a promise