Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object.hasOwn vs Object.prototype.hasOwnProperty
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0
Browser:
Firefox 149
Operating system:
Linux
Device Platform:
Desktop
Date tested:
8 days ago
Test name
Executions per second
Object.hasOwn
0.8 Ops/sec
Object.prototype.hasOwnProperty
0.7 Ops/sec
Script Preparation code:
window.myObject = {}; window.mySet = new Set(); for (let i = 1; i < 10_000_000; i++) { window.myObject[i] = null; window.mySet.add(i); }
Tests:
Object.hasOwn
for (let i = 10_000_000; i > 0; i--) { Object.hasOwn(window.myObject, i); }
Object.prototype.hasOwnProperty
for (let i = 10_000_000; i > 0; i--) { window.myObject.hasOwnProperty(i); }