title: How to tell if an ES6 class has a getter of given name?
body: <p>It seems like ES6 classes don't respond to .hasOwnProperty as one might expect.  </p>
  
  <p>If you have this class:</p>
  
  <pre><code>class Foo {
    get index() {
      return 12;
    }
  }
  </code></pre>
  
  <p>This code will return false:</p>
  
  <pre><code>let myFoo = new Foo();
  alert(myFoo.hasOwnProperty("index"); &lt;-- alerts "false"
  </code></pre>
  
  <p>I could test if a property  returns "undefined" but that wouldn't discriminate between a "get" that returns undefined and an class object that has no method with the given name, i.e.</p>
  
  <pre><code>class Foo {
    get index() {
      return 12;
    }
    get position() {
      return undefined;
    }
  }
  </code></pre>
  
  <p>Whats the right way to test for presence of a "getter" or "setter" on ES6 classes?</p>