Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MAKE FUNCTION
- function sum(a,b) {
- return a+b;
- }
- function make(){
- var res = [].slice.call(arguments);
- return function innerFunc(){
- if(typeof arguments[0] != 'function'){
- var args = [].slice.call(arguments);
- res = res.concat(args);
- return innerFunc;
- }else{
- return res = res.reduce(arguments[0]);
- }
- }
- }
- make(23,12)(1)(45)(2,34,7)(sum);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement