I am just wondering why self execution code should be needed when implement module pattern in javascript.
Following code is typical module pattern sample :
var app = app || {};
app.model = app.model || {};
app.model.person = (function () {
var say = function () {
alert('say');
};
return {
saySomething: say
}
})();
But, I cannot find out the reason why this function should be self executed with closing curly brace.