Studying this code: in need of explanation

Hello,

Today, I’m studying Lea Verou’s prefixfree: https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.js

I have a question about this approach:



(function(){


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

...


Wht is the reason to use var self = … ?

:slight_smile:

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?