title: javascript pass object as reference
body: <p>i have a object, which is getting passed in many different functions inside a function. these functions may or may not change the value of the object, but if they do change it, then i would like to get the latest changes on object.</p>
  
  <p>following is what im trying to do:</p>
  
  <pre><code>var ob = {text: 'this is me', name: 'john'}
  
  function (object) {
  
       changeObject(object);
       customObjectChanger(object);
       callback = function (object) {
            object.text = 'new text';
       }
  
       callback(object);
  
       // object value here should be object{text: 'new text', name: 'john'};    
  }
  </code></pre>