Benefit of using Object.hasOwnProperty vs testing if Property is undefined
Since hasOwnProperty has some caveats and quirks (window / extensive use in ie8 issues / etc). I was wondering if there is any reason to even use it , and if simply testing if a property is undefined is better justified & more simplistic. For example: var obj = { a : 'here' }; if (obj.hasOwnProperty('a')) { /* do something */ } if (obj.a !== undefined) { /* do something */ } // or maybe (typeof (obj.a) !== 'undefined') Just wondering if anyone has any good insight on this, I'd prefer to be using the most cross-browser friendly, and up to date methodology. I've also seen this prototype over