Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function add(){
let args = [].slice.apply(arguments);
function resultFn(){
args = args.concat([].slice.apply(arguments));
if(args.length>=3){
return args.slice(0,3).reduce(function(acc,next){ return acc+next},0)
}
return resultFn
}
return resultFn();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.