Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
undefined vs. typeof vs. in vs. operator
Object lookup performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 8.1.0; ASUS_X00HD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.6613.127 Mobile Safari/537.36
Browser:
Chrome Mobile 128
Operating system:
Android 8.1.0
Device Platform:
Mobile
Date tested:
one year ago
bool
1.1M/s
typeof
1.1M/s
in
1.1M/s
operator
1.1M/s
undefined
378K/s
View exact numbers
Test name
Executions per second
✓
bool
1,117,798 Ops/sec
typeof
1,112,840 Ops/sec
in
1,100,611 Ops/sec
operator
1,094,132 Ops/sec
undefined
378,464 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;
operator
obj.d >= 0;
bool
!! obj.d;