title: Use argument as variable name (Javascript)
body: <p>I can't seem to find a question that answers this directly.</p>
  
  <p>I'd like to use a function argument as the name of a variable within that function.</p>
  
  <p>e.g.,</p>
  
  <pre><code>test(var1);
  
  function test(foo)
  {
      var foo = 'Hello world!'; // Set var1
  }
  
  alert(var1); // Hello world!
  </code></pre>
  
  <p>Can I use the brackets here (i.e., window.[ ])?</p>