# Read and test the value of a property inside an object that is inside another object

**URL:** <https://discourse.nodered.org/t/read-and-test-the-value-of-a-property-inside-an-object-that-is-inside-another-object/16313>\
**Category:** General\
**Created:** [4 October 2019 11:58 UTC](https://discourse.nodered.org/t/read-and-test-the-value-of-a-property-inside-an-object-that-is-inside-another-object/16313 "2019-10-04T11:58:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![clickworkorange](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/clickworkorange/32/12109_2.png) [@clickworkorange](https://discourse.nodered.org/u/clickworkorange)\
**Post date:** [4 October 2019 12:47 UTC](https://discourse.nodered.org/t/read-and-test-the-value-of-a-property-inside-an-object-that-is-inside-another-object/16313/4 "2019-10-04T12:47:15Z")

</div>

This works because JavaScript "[short circuits](https://codeburst.io/javascript-short-circuit-evaluation-3709ffda6384)" `or` statements; when the first argument ( `typeof msg.payload === 'undefined'`) is `true` it does not proceed to check the second one (`typeof msg.payload.condition` === `'undefined'`), thereby avoiding an error should `msg.payload` be undefined.

---

_[View the full topic](https://discourse.nodered.org/t/read-and-test-the-value-of-a-property-inside-an-object-that-is-inside-another-object/16313)._
