title: How curry function should really work?
body: <p>I have function that look like this:</p>
  
  <pre><code>function curry(fn) {
      var args = [].slice.call(arguments, 1);
      return function() {
          return fn.call(this, args.concat([].slice.call(arguments)));
      };
  }
  </code></pre>
  
  <p>I always thought that's how the function should look like and should work as:</p>
  
  <pre><code>function add(a, b, c, d) {
     return a+b+c+d;
  }
  
  
  curry(add, 1, 2)(3, 4);
  </code></pre>
  
  <p>but <a href="https://en.wikipedia.org/wiki/Currying" rel="nofollow">Wikipedia Article</a> says that </p>
  
  <blockquote>
    <p>it can be called as a chain of functions, each with a single argument</p>
  </blockquote>
  
  <p>so the curry should look like this:</p>
  
  <pre><code>function curry(fn) {
      var args = [];
      return function curring() {
          args = args.concat([].slice.call(arguments));
          if (args.length &gt;= fn.length) {
              return fn.apply(this, args);
          } else {
              return curring;
          }
      };
  }
  </code></pre>
  
  <p>and be used as this:</p>
  
  <pre><code>function add(a, b, c, d) {
     return a+b+c+d;
  }
  
  curry(add)(1)(2)(3)(4);
  </code></pre>
  
  <p>Am I right?</p>