title: Javascript : Check if object has properties
body: <p>There are several answers here how to check if a property exists in an object.</p>
  
  <p>I was always using</p>
  
  <pre><code>if(myObj.hasOwnProperty('propName'))
  </code></pre>
  
  <p>but I wonder if there is any difference from </p>
  
  <pre><code>if('propName' in myObj){
  </code></pre>