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:
one year ago
Test name
Executions per second
case 1
1009767680.0 Ops/sec
case 2
1018253568.0 Ops/sec
case 3
18096204.0 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;