const compose = (...fns) => x => fns.reduceRight((v, f) => f(v), x);
const pipe = (...fns) => x => fns.reduce((v, f) => f(v), x);
// compose(g, h)(x) === pipe(h, g)(x)compose(g, h) and pipe(h, g) produce the same result β they differ only in order.
Compose and pipe do the same thing but in opposite orders. Their composed results should be equivalent when used correctly.
Challenge: Prove that compose(f, g)(x) equals pipe(g, f)(x) by implementing both and testing their equivalence.