Get rid of arguments for bind

This commit is contained in:
Siarhei
2018-08-09 11:50:24 +04:00
parent 520c9b6699
commit e726ed14db
2 changed files with 2 additions and 8 deletions

View File

@ -1,5 +1,2 @@
const bind = (fn, context, ...args) =>
function() {
return fn.apply(context, args.concat(...arguments));
};
const bind = (fn, context, ...boundArgs) => (...args) => fn.apply(context, [...boundArgs, ...args]);
module.exports = bind;