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
Post a Comment