Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Firefox 111
Windows
Desktop
2 years ago
Test name Executions per second
Object.prototype.hasOwnProperty 868353088.0 Ops/sec
obj.hasOwnProperty 874188544.0 Ops/sec
Object.hasOwn 856015808.0 Ops/sec
Script Preparation code:
AخA
 
obj = {a: 42, b:66, c: 88}
Tests:
  • Object.prototype.hasOwnProperty

     
    Object.prototype.hasOwnProperty.call(obj, 'b');
  • obj.hasOwnProperty

     
    obj.hasOwnProperty('b');
  • Object.hasOwn

     
    Object.hasOwn(obj, 'b')