Studying this code: in need of explanation


Today, I’m studying Lea Verou’s prefixfree:

I have a question about this approach:


var self = window.StyleFix = {
	link: function(link) {
		try {
		catch(e) {


Wht is the reason to use var self = … ?


Seemingly to get a reference to the the object being generated, without having to use closures or other techniques.
self is an ill-advised name choice because it overwrites window.self, which other scripts may try to use.

Thanks for your reply :slight_smile:
Why would one avoid closures?