Augusto Moura (2018-07-19T14:40:21.000Z)
augusto.borgesm at gmail.com (2018-07-19T14:46:19.531Z)
In most of the use cases of checking if a property is in the prototype chain (checking a protocol for example) you *do* want to trigger getters and Proxy traps. When interfacing with a object a developer doesn't need to be concerned with the implementation behind, if a getter or proxy trap does a intensive computation or has side effects, it's all bad class/object design fault. A common example when you want to check a property "return" rather than it's existence it's virtual properties or class refactoring: ``` js // old implementation class Foo { constructor() { this.foo = 46; } } // post refactoring class Foo { // implements something different // Product of refactoring, undefined it's a placeholder here //it can be any value that makes sense in the refactoring get foo() { return undefined; } set foo(_) {} } ``` Of course there's some use cases to use property check without triggering side effects (mostly when working with property descriptors), but the majority of "property existence check" lays on interface assertion and a typeof check it's ~generally~ the right choice. About the `!in` operator, I don't see any problem in it. Of couse the usage of `in` is most of the time is not recommended, but it has it place. Also it puts precedence to future operators (like the `hasOwn` proposed here).