xxxxxxxxxx
const pipe = (functions) => (value) => {
return functions.reduce((currentValue, currentFunction) => {
return currentFunction(currentValue);
}, value);
};
const pipe = (functions) => (input) => functions.reduce((chain, func) => func(chain), input);
xxxxxxxxxx
//A pipe function is a function that accepts a series of functions,
//which process an input parameter and return a output which will be the
//input for the next function.