I've recently stumbled across this (http://www.jibbering.com/faq/faq_notes/closures.html) article. It covers (in-depth) JavaScript closures, what they are and how to use them correctly. I wish I would've read this article about half a year ago. It would've saved me a lot of frustration and time spent experimenting.
I'm often using closures in my classes to emulate private members. They can be very powerful allies and are probably one of the main reasons why JavaScript is so dynamic. At the same time they can be quite treacherous and lead to the resource waste, especially in IE with it's memory leak problems. In general I prefer to keep closure use to the minimum.
Here's another good article on closure in global scope.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5