Access JS object with a key
<p>I can access a value like <code>driver.my_friends["793659690"].name</code> but now I am using it in a loop where <code>key</code> will hold the key.</p>

<p><code>driver.my_friends[key].name</code> doesn't work. Says undefined, and <code>driver.my_friends["key"].name</code> will look for a key named key. So how do I use it so that the variable of the variable is evaluated too.</p>
