Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Set.prototype.has vs Object.hasOwn
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Browser:
Firefox 136
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Object.hasOwn
10739.5 Ops/sec
Set.prototype.has
11676.4 Ops/sec
Script Preparation code:
window.myObject = {}; window.mySet = new Set(); for (let i = 1; i < 1001; i++) { window.myObject[i] = null; window.mySet.add(i); }
Tests:
Object.hasOwn
for (let i = 1000; i > 0; i--) { Object.hasOwn(window.myObject, i); }
Set.prototype.has
for (let i = 1000; i > 0; i--) { window.mySet.has(i); }