javascript - Arguments of self executing function -


(function (global, undefined) {   ... code doesnt use arguments array } (this)); 

i see module pattern done in way.

i question why there's second argument undefined? these examples buggy or there special meaning of undefined here?

undefined global property used. in older versions of javascript possible change value of (for example, true). breaks everything. changing scope local "module" (i.e. function), other modules prevented interfering it.

this allows code safely use undefined instead of having use global.undefined.

mdn reference


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -