title: How to check if object has property javascript?
body: <p>I have this function:</p>
  
  <pre><code>      function ddd(object) {
          if (object.id !== null) {
              //do something...
          } 
      }
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>Cannot read property 'id' of null
  </code></pre>
  
  <p>How can I check if object has property and to check the property value??</p>