This is called the module pattern (at least thats the name I know it by).
http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html
Some benefits of this pattern include: 
- Encapsulation, giving you the ability to define private fields in your closure. 
- You can make sure that the undefined value is always correct by specifying a third parameter of undefined and passing nothing to it (this is because undefined can actually be overwritten in javascript.) 
- Javascript namespacing for clearer separation of concerns. 
And example of using the undefined method is this:
var AppName = (function (parent, $, undefined) { //add parameter for undefined here
  var controller = parent.controller = parent.controller || {};
  controller.index_page = function (parent) {
    var createPage = parent.createPage = parent.createPage || {};
    createPage.init = function () {
      alert('javascript initialized');
    };
    return createPage;
  }(controller);
  return parent;
}(AppName || {}, jQuery)); //do not define anything for the undefined parameter here.
The purpose of the parenthesis at the end of the function is to invoke your function immediately and form a closure, giving you access to public variables/functions whilst hiding private variables/functions. This is known as an immediately invoked function expression(IIFE) sometimes called an iffy.