Advertisement
dhshin

practice_14

Jun 26th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function add(a, b) { return a + b; }
  2. function sub(a, b) { return a - b; }
  3.  
  4. function calculator(op, a, b) { return op(a, b); }
  5.  
  6. console.log(calculator(add, 2, 3));
  7. console.log(calculator(sub, 5, 1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement