title: Javascript: why Object.keys(someobject), rather than someobject.keys?
body: <p>I frequently get an array of an objects keys using: </p>
  
  <pre><code>Object.keys(someobject)
  </code></pre>
  
  <p>I'm comfortable doing this. I understand that Object is the Object constructor function, and keys() is a method of it, and that keys() will return a list of keys on whatever object is given as the first parameter. My <strong>question is not how to get the keys of an object</strong> - please do not reply with  non-answers explaining this. </p>
  
  <p>My question is, <strong>why isn't there a more predictable keys() or getKeys() method, or keys instance variable available on Object.prototype</strong>, so I can have: </p>
  
  <pre><code>someobject.keys()
  </code></pre>
  
  <p>or as an instance variable:</p>
  
  <pre><code>someobject.keys
  </code></pre>
  
  <p>And return the array of keys?</p>
  
  <p>Again, my intention is to understand the design of Javascript, and what purpose the somewhat unintuitive mechanism of fetching keys serves. I don't need help getting keys.</p>