title: Javascript - retrieve object property path
body: <p>I have the following object</p>
  
  <pre><code>var obj = {};
  obj.foo = {};
  obj.foo.bar = "I want this";
  </code></pre>
  
  <p>given the "path" <code>"foo.bar"</code> as a string, how do I retrieve <code>obj.foo.bar</code> (or <code>obj[foo][bar]</code>)?</p>