title: Is there any way to get only the unnamed arguments?
body: <p>In JavaScript functions, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments" rel="nofollow"><code>arguments</code></a> is an array-like object containing all arguments to the function, whether they are named or not:</p>
  
  <pre><code>function f(foo, bar) {
      console.log(arguments);
  }
  f(1, '2', 'foo'); // [1, "2", "foo"]
  </code></pre>
  
  <p>Is there a way to get <em>only</em> the arguments that are not named, so you could do something like this?</p>
  
  <pre><code>function f(foo, bar) {
      console.log('foo:', foo, 'bar:', bar, 'the rest:', unnamedArguments);
  }
  f(1, '2', 'foo'); // foo: 1 bar: "2" the rest: ["foo"]
  </code></pre>
  
  <h2>But why?</h2>
  
  <p>A real-world use case is for injecting Angular modules as arguments into RequireJS modules:</p>
  
  <pre><code>define([
      'angular',
      'myLibModule', // Exports an Angular module object
      'myOtherLibModule', // Exports an Angular module object
  ], function(angular, myLibModule, myOtherLibModule) {
      angular.module('MyApp', [myLibModule.name, myOtherLibModule.name]);
  });
  </code></pre>
  
  <p>As the list of module dependencies can get quite large, this quickly becomes very cumbersome. While I could solve it as</p>
  
  <pre><code>define([
      'angular',
      'underscore',
      'myLibModule', // Exports an Angular module object
      'myOtherLibModule', // Exports an Angular module object
  ], function(angular, _) {
      function angularModuleNames(modules) {
          return _.pluck(_.pick(modules, function(item) {
              return _.has(item, 'name');
          }), 'name');
      }
      angular.module('MyApp', angularModuleNames(arguments));
  });
  </code></pre>
  
  <p>this is also rather cumbersome, and it would be nice if I could do something like this instead:</p>
  
  <pre><code>define([
      'angular',
      'underscore',
      'myLibModule', // Exports an Angular module object
      'myOtherLibModule', // Exports an Angular module object
  ], function(angular, _) {
      angular.module('MyApp', _.pluck(unnamedArguments, 'name'));
  });
  </code></pre>
  
  <p>Of course, a way to group dependencies in RequireJS would suffice just as well for this particular use case.</p>