January 2020
Intermediate to advanced
470 pages
11h 13m
English
We can also go back to our pipeline. We had written a single-line function to count the odt files in a given path:
const countOdtFiles2 = path => count(filterOdt(getDir(path)));
Disregarding (at least for the moment) the observation that this code is not as clear as the pipeline version that we got to develop later, we could have also written this function with composition:
const countOdtFiles2b = path => compose(count, filterOdt, getDir)(path);countOdtFiles2b("/home/fkereki/Documents"); // 4, no change here
It would ...
Read now
Unlock full access