Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const increment = v => v + 5;
- const double = v => v * 2;
- const incrementOfDouble = compose(increment, double); // x => increment(double(x));
- // It is the composition of increment with double, so we increment the double of x.
- incrementOfDouble(5); // 11
- // And so 5 get doubled before we increment it,
- // even though we passed increment before double to the compose function
Add Comment
Please, Sign In to add comment