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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15
Browser:
Safari 18
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
operator
223.1M/s
bool
223.0M/s
undefined
216.8M/s
typeof
204.2M/s
in
203.6M/s
View exact numbers
Test name
Executions per second
✓
operator
223,116,496 Ops/sec
bool
222,977,104 Ops/sec
undefined
216,754,368 Ops/sec
typeof
204,175,264 Ops/sec
in
203,588,512 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;