I can’t seem to find an answer for this anywhere on the ‘Net…
Is there any reason, advantage, or disadvantage to redeclaring function parameters as local variables?
Example:
function(param1, param2) {
var param1, param2;
...etc...
}
Seems extremely redundant to me, but maybe I’m missing something…?
Thanks,
Brian
If the names of the declared variables are the same as the ones as the function parameters then it does absolutely nothing. Completely worthless. Doesn’t even change the value of the variable.