Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
hasOwnProperty vs direct access (bool) vs in
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
in
162.7M/s
direct access (bool)
159.0M/s
hasOwnProperty
64.6M/s
View exact numbers
Test name
Executions per second
✓
in
162,691,312 Ops/sec
direct access (bool)
158,996,544 Ops/sec
hasOwnProperty
64,563,732 Ops/sec
Script Preparation code:
var x = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9}
Tests:
hasOwnProperty
x.hasOwnProperty("a")
direct access (bool)
x["a"]
in
"a" in x