title: JavaScript: Get Argument Value and NAME of Passed Variable
body: <p>What I want to do is get the NAME of a variable passed to a function <em>and</em> the VALUE of that variable, and only have to pass in one variable to the function. So:</p>
  
  <pre><code>var x = "anything";
  
  function showName() {
  
  }
  
  showName(x);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>showName("x");
  </code></pre>
  
  <p>Which will return: "x = anything".</p>
  
  <p>Right now, I have to specify the variable twice:</p>
  
  <pre><code>showName("x", x);
  </code></pre>
  
  <p>In order to get the name and value of the variable I am passing in. </p>
  
  <p>Note that I am not interested in the name of argument in the prototype of showName, but the name of the variable in the calling function.  Also, the variable passed may be local, so I can't use the window object to find the variable.</p>