string as object reference to object variable
<p><code>var string = 'object.data.path';</code></p>

<p>That's a string that resembles a path to variable.</p>

<p>How can I return the corresponding variable from that string?</p>

<p>Something like transforming the string into <code>return object.data.path;</code></p>

<p>The thing behind this is that the string could be much longer (deeper), like:</p>

<p><code>var string = 'object.data.path.original.result';</code></p>
