瀏覽代碼

function: simplify arguments

mightyplow 7 年之前
父節點
當前提交
82192efd0b
共有 1 個文件被更改,包括 2 次插入3 次删除
  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));