What is the point of returning methods in the following example when you can accomplish the same thing by just declaring the NS straightforward in the second code snippet?
1:
var NS = function() {
return {
method_1 : function() {
// do stuff here
},
method_2 : function() {
// do stuff here
}
};
}();
2:
var NS = {
method_1 : function() { do stuff },
method_2 : function() { do stuff }
};