|
|
William F Pokorny <ano### [at] anonymousorg> wrote:
> Though long a user of user functions, today I ran face first into a
> parameter naming trap which had me tangled up for hours. Though perhaps
> not too surprising in hindsight, thought I'd pass along the lesson learned.
>
> Fn0 = function (x,y,z) {...} // OK. Pass anything you want for x,y,z.
>
> Fn1 = function (v) {...} // OK. Pass anything you want for v.
>
> Fn2 = function (x,y,z,v) // Boom! What you pass for v overwrites y.
>
> Looks to be related to u and v being synonyms for x and y. Something like:
>
> Fn3 = function (x,y,z,_v) {...} // OK. Pass what you want.
>
> Bill P.
Interesting! Thanks for the breakdown. I think I ran into a similar problem at
some point in the past year, but didn't try to pursue it (due to sheer lack of
understanding) and moved on.
Post a reply to this message
|
|