const pipe = (...fns) => (x) => fns.reduce((y, f) => f(y), x);
const add2 = x => x + 2;
const multiply3 = x => x * 3;
const toString = x => x.toString();
const process = pipe(add2, multiply3, toString);
const result = process(5);
console.log(result);
This code demonstrates 'Function composition with a pipeline'. The `pipe` function takes multiple functions and returns a new function that passes its input through each function in sequence, from left to right. This contrasts with traditional `compose` which applies functions from right to left. When we call `process(5)`, the value 5 flows through the pipeline: first `add2` makes it 7, then `multiply3` makes it 21, and finally `toString` converts it to the string '21'. Pipelines like this are common in functional programming for creating data transformation flows, and currying makes functions more suitable for composition in such pipelines. Libraries like Ramda and lodash/fp provide similar utilities for real-world applications.