SHARE
TWEET

Untitled

a guest Aug 17th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Adder
  2.  
  3. const createAdder = a => {
  4.   return b => {
  5.     return a + b;
  6.   };
  7. };
  8.  
  9. const add10 = createAdder(10);
  10. console.log(add10(-2)); // turns into 8
  11. console.log(add10(20)); // turns into 30
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top