title: Why use Object.prototype.hasOwnProperty.call(myObj, prop) instead of myObj.hasOwnProperty(prop)?
body: <p>If I understand correctly, each and every object in JavaScript inherits from the Object prototype, which means that each and every object in JavaScript has access to the hasOwnProperty function through its prototype chain.</p>
  <p>While reading <a href="https://requirejs.org/" rel="noreferrer">RequireJS</a>' source code, I stumbled upon this function:</p>
  <pre><code>function hasProp(obj, prop) {
      return hasOwn.call(obj, prop);
  }
  </code></pre>
  <p><code>hasOwn</code> is a reference to <code>Object.prototype.hasOwnProperty</code>. Is there any practical difference to writing this function as</p>
  <pre><code>function hasProp(obj, prop) {
      return obj.hasOwnProperty(prop);
  }
  </code></pre>
  <p>And since we are at it, why do we define this function at all? Is it just a question of shortcuts and local caching of property access for (slight) performance gains, or am I missing any cases where hasOwnProperty might be used on objects which don't have this method?</p>