title: How to change the properties with factory method in javascript
body: <p>i have one class i am trying to overwrite it with factory design pattern but not able to do that..
   how to call it exactly to change the properties of object</p>
  
  <pre><code>function othername() {
  var newobj = new Object();
      newobj.fname = "sachin",
           newobj.lname = "rawal",
               newobj.fullname = function () {
               alert(this.fname);
               }
               return newobj
  }
  
  var othername1 = othername ("hi","hello");
  </code></pre>