title: JavaScript objects as function parameters
body: <p>Using JavaScript, say I have a function X, and in that function an object called objectX is created. function X returns objectX.  Later in the code function Z(somevar, anObject) receives objectX as one of it's  parameters.</p>
  
  <p>Now in function Z, is objectX and all its properties referred to as anObject inside function Z?</p>
  
  <p>And what happens if function Z returns anObject?  Will the rest of the code see the object as "objectX" or "anObject"?</p>
  
  <pre><code>function X() {
      ...
      objectX = {};
      ...
      return objectX;
  }
  
  X();
  
  function Z(anything, anObject) {
      ...
      return anObject
  }
  
  Z(something, objectX);
  </code></pre>