Wow. I didn't realize how powerful reduce is. Before, I only used it to calculate a single value from an array like a sum. Using it to return another array or a composition of functions is super interesting.
I used the idea behind the pipe function for the callback hell problem and it worked great https://jsfiddle.net/ew3qaL8p/1/ thanks