Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134
Windows
Desktop
16 days ago
Test name Executions per second
in 125213264.0 Ops/sec
Object.hasOwn 55485684.0 Ops/sec
Object.prototype.hasOwnProperty 63428716.0 Ops/sec
Script Preparation code:
AخA
 
var obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };
Tests:
  • in

     
    'c' in obj
  • Object.hasOwn

     
    Object.hasOwn(obj, 'c')
  • Object.prototype.hasOwnProperty

     
    obj.hasOwnProperty('c')