Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sum(arg1, arg2){
- if (arg2 == undefined){
- return function(arg_){
- return arg1+arg_;
- }
- }
- return arg1 + arg2;
- }
- console.log( sum(2,3) == sum(2)(3) );
- console.log( sum(2)(3) == 5 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement