Originally Posted by rnd me
AFAIK, the inner scope of variables is not affected in event handlers (Right is already closured).
but the issue with rewriting holds true.
- forget everything you know about classes, itís irrelevant in JS because itís not class-based but object-based
- itís recommended to start Constructors (like the Button() function) upper-case and properties/methods lower-case (for better distinction)
- methods (except in special cicumstances) should be put into the objectís prototype
(memory management and such)
- functions are objects, too
- (therefore) there is no programmatical difference between a method and a property