title: JavaScript: Define variable name with function parameter
body: <p><strong>Is it possible in JavaScript to define a variable name with a function parameter?</strong></p>
  
  <p>Here is <strong><a href="http://jsfiddle.net/markrummel/zVM9M/" rel="nofollow">my jsFiddle</a></strong>. In the example below, I would like <code>varB</code> to be defined as <code>null</code> when it is passed through <code>makeNull(varName)</code>:</p>
  
  <pre><code>var varA = undefined;
  if (varA == undefined) {
    varA = null;
  }
  var varB = undefined;
  
  makeNull(varB);
  
  function makeNull(varName) {
    if (varName == undefined) {
      varName = null;   
    }
  }  
  
  alert (varA + ' | ' + varB);
  </code></pre>
  
  <p>​</p>