Understanding javascript functions, scope and closures -



Understanding javascript functions, scope and closures -

can explain in detail snippet of js does?

(function (window) { var test = window['test'] = {}; test.utils = new(function(){ ... })(); })(window);

i understand function not globally scoped. understand creating variable called test points property in window object empty object. understand utils property of test.

i don't understand purpose of lastly part (window); or why utils function beingness designated new.

please explain.

javascript scope closures

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -