3 ms·
I stand corrected, you are right. Then the only thing I can think about is that accepting it as an additional parameter in the function call is less overhead (
by stingraycharles 15y ago
I stand corrected, you are right.
Then the only thing I can think about is that accepting it as an additional parameter in the function call is less overhead (as in, bytes) than defining 'b' as a var:
function a(b)
{
b = 10;
}
is smaller than
function a()
{
var b = 10;
}
and doesn't pollute the global namespace.
EDIT: I see dave1010uk also said this.