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:140.0) Gecko/20100101 Firefox/140.0
Browser:
Firefox 140
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
typeof
973.4M/s
in
900.4M/s
hasOwnProperty
873.6M/s
undefined
866.2M/s
bool
863.7M/s
View exact numbers
Test name
Executions per second
✓
typeof
973,419,200 Ops/sec
in
900,442,496 Ops/sec
hasOwnProperty
873,620,032 Ops/sec
undefined
866,236,352 Ops/sec
bool
863,692,608 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;