title: Prepend argument to arguments then apply
body: <p>I have a function, <code>message</code> that takes one param to define the type of message and then it joins any other arguments to form the message, purely a nicety.</p>
  
  <p>It looks like this:</p>
  
  <pre><code>function message(type) {
      var msg = _.rest(arguments).join(" ");
  
      // Really the type will be used to set the class on a div
      // But I'm just using console.log to keep it simple for now.
      console.log(type + ": " + msg);
  }
  </code></pre>
  
  <p>I want to provide helper functions, <code>error</code>, <code>warning</code>, <code>info</code>, which simply call <code>message</code> with the right type. I'm just unsure on the best way to go about this. I cant think of two ways but I'm not sure if I'm going about it correctly or that perhaps I'm overcomplicating things.</p>
  
  <p>The first way seems a bit redundant, make a new array containing the first arg and the arguments then flatten it.</p>
  
  <pre><code>message.apply(this, _.flatten(["error", arguments]));
  </code></pre>
  
  <p>The second way feels a bit... messy?</p>
  
  <pre><code>Array.prototype.unshift.call(arguments, "error");
  message.apply(this, arguments);
  </code></pre>
  
  <p>Though from my experiement:</p>
  
  <pre><code>(function() {
      Array.prototype.unshift.call(arguments, 0);
      console,log(arguments);
  })(1, 2, 3);
  </code></pre>
  
  <p>I get the following output:</p>
  
  <pre><code>[0, 1, 2, 3, undefined, undefined, undefined, ..., undefined]
  </code></pre>