title: Javascript: Pass Hash Key as Parameter
body: <p>I have a hash called 'tag' with several keys, including width, height, x, and y. I also have this function:</p>
  
  <pre><code>function invertCoordinates(measure, coordinate){
      tag.measure = tag.measure * -1;
      tag.coordinate = tag.coordinate - tag.measure;
  }
  </code></pre>
  
  <p>In which I want to pass tag's keys:</p>
  
  <pre><code>invertCoordinates(width, x);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>invertCoordinates(height, y);
  </code></pre>
  
  <p>Unfortunately, I can't pass keys in this manner. Is there some other way to accomplish this?</p>