Reference Javascript object from string
<p>Given data similar to:</p>

<pre><code>var data = [{id: 12345, 
    name:'my products', 
    items:[{ 
               size: 'XXL', 
               sku: 'awe2345', 
               prices:[{type: 'rrp',prices: 10.99}, 
                        {type: 'sell_price', price: 9.99}, 
                         {type:'dealer', price:4.50} 
               ] 
               },{ 
               size: 'XL', 
               sku: 'awe2346', 
               prices:[{type: 'rep', prices: 10.99}, 
                          {type: 'sell_price', price: 9.99}, 
                          {type:'dealer', price:4.50} 
               ] 
               } 
       ] 
   }] 
}]
</code></pre>

<p>is there a way to evaluate a string representation of an element in the data object? for example: "data[0].items[0].prices[0].rrp" ...without using eval()?</p>
