Using a string to reference an object name
<p>I'm trying to replicate a "feature" of PHP (And in most languages) in Javascript.</p>

<p>Here it is in PHP:</p>

<pre><code>$objectName = 'ObjectA';

$someObject-&gt;$objectName-&gt;someMethod();
</code></pre>

<p>Basically using a string variable to reference an object variable.</p>

<p>So in Javascript, I was hoping to do something like:</p>

<pre><code>var objectName = "ObjectA";

someObject.[objectName].someMethod();
</code></pre>

<p>Anyone know how to do this? Or if its even possible?</p>
