title: referencing an array javascript
body: <p>Working with the following code:</p>
  
  <pre><code>Array0 = ['a', 'b', 'c'];
  Array1 = ['c', 'd', 'e'];
  Array2 = ['x', 'a', 'd'];
  ...
  
  /*
  doStuff() is a recursive function whose argument is an abitrary length array
  containing an arbitrary list of array names
  e.g., anArr = ['Array1', 'Array0', 'Array1', 'Array2', ...]
  */
  
  function doStuff(anArr) {
  
      for(i=0; i&lt;anArr.length; i++)   {
  
        switch(anArr[i])  {
        case('Array0')    :   Array0.myMethod(); break;
        case('Array1')    :   Array1.myMethod(); break;
        case('Array2')    :   Array2.myMethod(); break;
        }
  
      }
  }
  </code></pre>
  
  <p>Is there a way to replace the switch() block with a single statement:</p>
  
  <pre><code>&lt;&lt;array referenced by 'someArray'&gt;&gt;.aMethod()   //or
  function aFunction (&lt;&lt;array referenced by 'someArray'&gt;&gt;){}
  </code></pre>
  
  <p>Plain Javascript, please - no jquery or other library.
  Thanks</p>