Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
undefined vs. typeof vs. in vs. hasOwnProperty
Object lookup performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Browser:
Firefox 138
Operating system:
Windows
Device Platform:
Desktop
Date tested:
7 months ago
in
730.8M/s
hasOwnProperty
708.2M/s
undefined
695.0M/s
typeof
663.7M/s
bool
657.7M/s
View exact numbers
Test name
Executions per second
✓
in
730,780,288 Ops/sec
hasOwnProperty
708,181,056 Ops/sec
undefined
694,998,080 Ops/sec
typeof
663,690,048 Ops/sec
bool
657,673,536 Ops/sec
Script Preparation code:
var obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };
Tests:
undefined
undefined !== obj.d;
typeof
'undefined' !== typeof obj.d;
in
'd' in obj;
hasOwnProperty
obj.hasOwnProperty( 'd' );
bool
!! obj.d;