title: Overwriting arguments object for a Javascript function
body: <p>If I have the following:</p>
  
  <pre><code>    // Clean input.
      $.each(arguments, function(index, value) {
  
          arguments[index] = value.replace(/[\W\s]+/g, '').toLowerCase();
      });
  </code></pre>
  
  <p>Would that be a bad thing to do? I have no further use for the uncleaned arguments in the function, and it would be nice not to create a useless copy of <code>arguments</code> just to use them, but are there any negative effects to doing this?</p>
  
  <p>Ideally I would have done this, but I'm guessing this runs into problems since <code>arguments</code> isn't really an Array:</p>
  
  <pre><code>    arguments = $.map(arguments, function(value) {
  
          return value.replace(/[\W\s]+/g, '').toLowerCase();
      });
  </code></pre>
  
  <p>Thanks for any input.</p>
  
  <p>EDIT: I've just realized that both of these are now inside their own functions, so the arguments object has changed. Any way to do this without creating an unnecessary variable?</p>