Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
if undefined comparison
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Browser:
Chrome 120
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
case 2
1018.3M/s
case 1
1009.8M/s
case 3
18.1M/s
View exact numbers
Test name
Executions per second
✓
case 2
1,018,253,568 Ops/sec
case 1
1,009,767,680 Ops/sec
case 3
18,096,204 Ops/sec
Tests:
case 1
const obj = { 2: true, 7: true } if (obj[3]) { } obj[3] = true;
case 2
const obj = { 2: true, 7: true } if (typeof obj[3] !== 'undefined') { } obj[3] = true;
case 3
const obj = { 2: true, 7: true } if (obj[3] !== undefined) { } obj[3] = true;