WeWork Interview Question

Implement a function that takes an array of callbacks and calls a callback when everything in the array is done. How would you handle errors? Etc.