How do I dynamically get the value of a property of a JavaScript object?
<p>I might not know what to call this, but essentially I want to pass the name of the property dynamically and then get the value of that property within my objects data property. Something like this:</p>

<pre><code>function myFunc(e, myProperty) {

    alert( e.data[myProperty] );
}

var myValue = myFunc(myObject, "someField");
</code></pre>

<p>I get the value <em>undefined</em>.</p>

<p>I think the equivalent in ColdFusion would be something[myPropertyName] and I'm wondering if there is something similar in JavaScript.</p>

<p>UPDATE: Apparently getting the value works, but not where I'm trying to pass the dynamic property as a name/value pair to an AJAX request.</p>

<pre><code>var myValue = e.data[myProperty];

var myData = { myProperty: myValue }
</code></pre>

<p>In the code above <em>myProperty</em> is being passed as <em>"myProperty"</em></p>
