title: creating a object in javascript that has a 'init' method with optional name/value pairs
body: <p>I've seen many javascript objects that have a 'init' method that you pass in values to in order to setup the object.</p>
  
  <p>How do they internally handle the initializations of their private variables when passed in a array of name/value pairs like:</p>
  
  <p>myObject.init( 
         {prop1: "blah", prop2: "asdf", ..., propn: "n"}
  );</p>
  
  <p>Specifically, some of these values can be optional, so how would you setup defaults and then override them if the name/value pair was passed in during the init.</p>