I have t开发者_运维问答he following:
setup : function(first, middle, last) {
    // Clean input.
    $.each([first, middle, last], function(index, value) {
        ??? = value.replace(/[\W\s]+/g, '').toLowerCase();
    });
Is there a way I could get that to work? I've tried to figure out what to substitute instead of ??? (I've tried this, index, this[index], but can't seem to wrap my head around pointing to the original variables.
Thanks for any help.
Use the Arguments object.
setup : function(first, middle, last) {
    var args = arguments;
    $.each(arguments, function(index, value) {
        args[index] = value.replace(/[\W\s]+/g, '').toLowerCase();
    });
Example: http://jsfiddle.net/EfHQ2/
To modify arrays, use $.map() instead, and just return the new value:
var clean = $.map([first, middle, last], function(value, index) {
    return value.replace(/[\W\s]+/g, '').toLowerCase();
});
Better, use the special arguments object (as in Patrick's answer) in place of building a temporary array:
var clean = $.map(arguments, function(value, index) {
    return value.replace(/[\W\s]+/g, '').toLowerCase();
});
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论