title: Benefit of using Object.hasOwnProperty vs. testing if a property is undefined
body: <p>Since <strong>hasOwnProperty</strong> has some caveats and quirks (window / extensive use in Internet Explorer 8 issues, etc.):</p>
  <p><em>Is there any reason to even use it</em>? If simply testing if a property is undefined, is it better justified and more simplistic?</p>
  <p>For example:</p>
  <pre><code>var obj = { a : 'here' };
  
  if (obj.hasOwnProperty('a')) { /* do something */ }
  
  if (obj.a !== undefined) { /* do something */ }
  // Or maybe (typeof (obj.a) !== 'undefined')
  </code></pre>
  <p>I'd prefer to be using the most cross-browser friendly, and up to date methodology.</p>
  <p>I've also seen this prototype overwritten for hasOwnProperty, which works, but I'm not sold on its usefulness...</p>
  <pre><code>if (!Object.prototype.hasOwnProperty) {
      Object.prototype.hasOwnProperty = function(prop) {
          var proto = this.__proto__ || this.constructor.prototype;
          return (prop in this) &amp;&amp; (!(prop in proto) || proto[prop] !== this[prop]);
      };
  }
  </code></pre>