const add = a => b => a + b;
const double = x => x * 2;
const addThenDouble = x => double(add(0)(x));
addThenDouble(5); // 10Pure functions compose cleanly because they're self-contained with no hidden state.
One benefit of pure functions is that they compose reliably. You can chain them together without worrying about side effects.
Challenge: Compose two pure functions: add(a, b) and double(x). Implement addThenDouble which takes two numbers, adds them, then doubles the result.