Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Nullish coalescing (??) vs logical OR (||)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Logical OR (||)
1209.9M/s
Nullish coalescing (??) [short-circuit]
1199.1M/s
Logical OR (||) [short-circuit]
1167.3M/s
Nullish coalescing (??)
791.6M/s
View exact numbers
Test name
Executions per second
✓
Logical OR (||)
1,209,908,992 Ops/sec
Nullish coalescing (??) [short-circuit]
1,199,138,432 Ops/sec
Logical OR (||) [short-circuit]
1,167,273,472 Ops/sec
Nullish coalescing (??)
791,623,232 Ops/sec
Tests:
Nullish coalescing (??)
let x = null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? 1;
Logical OR (||)
let x = null || undefined || null || undefined || null || undefined || null || undefined || null || undefined || 1;
Nullish coalescing (??) [short-circuit]
let x = 1 ?? undefined ?? null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? 1;
Logical OR (||) [short-circuit]
let x = 1 || undefined || null || undefined || null || undefined || null || undefined || null || undefined || 1;