title: Difference between different object notations
body: <p>What is the difference between creating an object using an inline object constructor and creating an object by immediately invoking a contructor? I have always done the latter as it free's me from having to call something like init() myself and feels like the right thing to do, but I keep seeing the object notation in other people's code and was wondering if there is another difference I am not seeing.</p>
  
  <p>Example: </p>
  
  <pre><code>window.fooModule = {
  
    init: function() {
      this.bar = "cee";    
      doStuff();
    },
  
    doStuff: function() {
      ...
    }
  }
  
  window.fooModule.init();
  </code></pre>
  
  <p>Example2:</p>
  
  <pre><code>window.fooModule = new function(){
    this.bar = "Cee";
  
    this.doStuff = function() {
      ...
    }
  
  
    this.doStuff();
  }
  </code></pre>