How to reuse object contructor?
<p>This is how I create objects from a hash of properties:</p>

<pre><code>var object = new function (data) {
  var self = this;
  self.property = data.property;
  self.anotherProperty = data.anotherProperty;

  self.method = function () { return 'something'; }
  self.update = function (newData) {
     //what is here ? 
     //i could have written:
     self.property = newData.property;
     self.anotherProperty = newData.anotherProperty;
     //but why not reuse the constructor?
   }
};
</code></pre>

<p>I wonder how to reuse this function (contructor) to update an object from hash.
So that:</p>

<pre><code>object.update(newData) 
</code></pre>

<p>would update current object properties from <code>newData</code> hash the same way it is done in the constructor function. </p>
