function sum(x) {
return function (y) {
return sum(x + y);
}
}
Function.prototype.part = function(){
var fn = this
, args = [].slice.call(arguments);
return function(){
return fn.apply(this, args.concat([].slice.call(arguments)));
}
}
function delegate(fn, ...base) {
return function(...args){
return fn.call(this, ...base, ...args);
}
}