title: Refer to a javascript object by string value - without using eval()
body: <p>Looked around SO and didn't find anything that seemed to match what I am trying to do..</p>
  
  <p>I am trying to reference an object by a string representation, though everywhere I look I see that using <code>eval()</code> is bad - though can't find a way to do this without using <code>eval()</code></p>
  
  <p>So my use case:</p>
  
  <p>I have a data attribute on a button; </p>
  
  <pre><code>data-original-data-object="window.app.myData.originalData"
  </code></pre>
  
  <p>When the button is clicked I need to access the actual object held at <code>window.app.myData.originalData</code></p>
  
  <p>Now, I know I can do:</p>
  
  <pre><code>var dataObj = eval($(this).data('original-data-object'));
  </code></pre>
  
  <p>Though is there any other way to do this?</p>
  
  <p>If it helps, the data that is stored at <code>window.app.myData.originalData</code> is a JSON object.</p>