One specific example is that of recursive functions; if the variables
within the function aren't var scoped, each recursion of the function
overwrites the previous variables, destroying the recursively created
data.

On 3/31/06, Paul Hastings <[EMAIL PROTECTED]> wrote:
> Loathe wrote:
> > What does var do?  When/why would you use it?
>
> it makes a variable private to that method. why use it? so you don't shoot
> yourself in the nether regions when other methods are called that might use 
> the
> same variable name or when that method is called in simultaneously (under a 
> load).

--
CFAJAX docs and other useful articles:
http://jr-holmes.coldfusionjournal.com/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236652
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to