Function composition typically looks like this:
let x = 1;
f(g(h(x)));
This works as long as the result of h(1)
is an acceptable parameter to g
and if the results of g(h(1))
is an acceptable parameter to f
.
To make this more concrete let's define these functions:
function f(num) { return num * 2; }