title: Shorthand function for checking whether a property exists
body: <p>Can you guys help me make a shorthand function determining whether an object property exists? In 99% of the cases I want to use it to check whether the returned json object contains the specified property or not. Note that there is no guarantee that any of the parent properties or even the json object itself must be defined.</p>
  
  <p>I was thinking of something in this manner:</p>
  
  <pre><code>function propertyExists(&lt;property&gt;) {
      // property is something like data.property.property
      return typeof(data) !== "undefined" &amp;&amp; typeof(data.property) !== "undefined" &amp;&amp; typeof(data.property.property) !== "undefined";
  }
  </code></pre>
  
  <p>I don't know how to write it in a dynamic manner to check all the parent properties. Also the in-parameter should be just a reference to the "data.property.property" and not a string, so I don't know how to find the parent properties within that either.</p>