title: What is this pattern called in Javascript? does it have a name?
body: <p>component.js</p>
  
  <pre><code>var component = (function(){
  
      var self;
  
      var default_options = {
          array_option : [],
          string_option : "default"
      };
  
      return {
  
          other_function: function(args) {
  
          },
          init: function(options) {
              self = this;
  
              // merge in user options 
              for (var attr in options) { 
                  if (options.hasOwnProperty(attr)) {
                      self.o[attr] = options[attr];
                  }
              }            
  
              /***
               * Initialize component
               */
  
              self.other_function(args);
          }
     };
  
  })();
  </code></pre>
  
  <p>then in the html</p>
  
  <pre><code>&lt;script src="component.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      // init the component
      component.init({
          array_option : [1,2,3],
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The reason I ask is I have seen it by example and thought it made sense, but is their any reading on why this is good practice? is this Object-Oriented Javascript?</p>
  
  <p>if this <strong>IS</strong> OO javascript, does this pattern make prototypal definitions useless?</p>
  
  <p><strong><em>Good answer to above question</em></strong></p>
  
  <p><a href="https://stackoverflow.com/questions/3790909/javascript-module-pattern-vs-constructor-prototype-pattern/3791059#3791059">Javascript: Module Pattern vs Constructor/Prototype pattern?</a></p>