Explorar o código

function: simplify arguments

mightyplow %!s(int64=7) %!d(string=hai) anos
pai
achega
82192efd0b
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      lib/function.js

+ 2 - 3
lib/function.js

@@ -10,9 +10,8 @@ const argsToArray = fn => {
 };
 
 const curry = fn => {
-    return function curried () {
-        const that = this,
-            args = Array.prototype.slice.call(arguments);
+    return function curried (...args) {
+        const that = this;
 
         if (args.length < fn.length) {
             return curried.bind.apply(curried, [that].concat(args));