Guest User

Untitled

a guest
Mar 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. const increment = v => v + 5;
  2. const double = v => v * 2;
  3.  
  4. const incrementOfDouble = compose(increment, double); // x => increment(double(x));
  5. // It is the composition of increment with double, so we increment the double of x.
  6. incrementOfDouble(5); // 11
  7. // And so 5 get doubled before we increment it,
  8. // even though we passed increment before double to the compose function
Add Comment
Please, Sign In to add comment