A practical approach to this exercise will be to determine the utility function as follows:
function pipe(f, g) {
return function(success, failure) {
f(function() {
g(success, failure)
}, failure)
}
}
, , . bothC :
var bothC = function (fC, gC, hC, success, failure) {
pipe(fC, gC)(success, failure);
};
:
var allC = function (funcList, success, failure) {
funcList.reduce(function(x, f) { return pipe(x, f)})(success, failure)
};