Guest User

Untitled

a guest
Dec 15th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. function adder() {
  2. return [].slice.call(arguments).reduce((a,b) => a + b);
  3. // return [...arguments].reduce((a,b) => a + b)
  4. }
  5.  
  6. let fn = adder;
  7. fn = fn.bind(null, 1);
  8. fn = fn.bind(null, 2,3,4,5)
  9. console.log(fn()) // 15
Add Comment
Please, Sign In to add comment