title: ActionScript 3: How do curry functions work?
body: <p>I just recently started looking at ActionScript code (as in, I literally just found out ActionScript was a thing yesterday). My only experience is with Java, so I have no idea how this code works:</p>
  
  <pre><code>public static function curry(func:Function,...args):Function
  {
      return function (...args2):*{
          return func.apply(null,args.concat(args2));
      };
  }
  </code></pre>
  
  <p>I don't understand what the asterisk is doing, where ...args2 came from (or what it is), or how you can have a return statement in a return statement. What would the equivalent Java code be? (Even if it's rather convoluted, I would probably be able to understand it a lot better.)</p>