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 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
undefined
1263.2M/s
in
1189.2M/s
typeof
1187.0M/s
bool
1164.6M/s
hasOwnProperty
1146.6M/s
View exact numbers
Test name
Executions per second
✓
undefined
1,263,180,416 Ops/sec
in
1,189,159,168 Ops/sec
typeof
1,186,975,616 Ops/sec
bool
1,164,637,568 Ops/sec
hasOwnProperty
1,146,589,824 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;