Michael Peters wrote:

> Just use the variable. It's not stored anywhere in the object or it's 
> prototype,
> it's just automatically available to it's lexical scope. It's called a 
> "closure"
> (http://en.wikipedia.org/wiki/Closure_%28computer_science%29).

I should clarify that for anyone else who's as pedantic as I am :)
Javascript doesn't have real lexical scope and just has subroutine scope. So the
closure does exist but you can get unexpected (well unexpected if you're used to
real lexical scop) results if you try using a closure in a loop with the looping
variables.

-- 
Michael Peters
Developer
Plus Three, LP


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to