JS: How to return 'undefined' instead of throwing error 'cannot read property x of undefined'
<p>What is the best way to have js return undefined rather than throw an error when a parent property does not exist?</p>

<p>Example</p>

<pre><code>a = {}
b = a.x.y.z
// Error: Cannot read property 'value' of undefined
// Target result: b = undefined
</code></pre>
