View Single Post
Old 09-01-2010, 03:07 AM   PM User | #16
DaveyErwin
Regular Coder

 
Join Date: Aug 2010
Posts: 806
Thanks: 12
Thanked 168 Times in 166 Posts
DaveyErwin is on a distinguished road
Quote:
Originally Posted by johnmerlino View Post
So if scope chaining is built into javascript (variable checks parent scope if not defined in current scope), then what's the added benefit of closures? Someone said that the benefit of closures is when interpreter exits parent function (e.g. Validation()), you can call the inner function later (e.g. $.Validation.getRule()) and gain access to the variables of the parent. Yet, in scope chaining, that happens anyway! So I absolutely see no benefit in closures.
I don't know if your talkin to me ?
But just look at the code i posted
for the very simple count down timer,
thats all about closures.
DaveyErwin is offline   Reply With Quote