Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
switch vs if js numbers
switch vs if
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0
Browser:
Firefox 139
Operating system:
Linux
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
if
260697504.0 Ops/sec
switch
930455936.0 Ops/sec
Tests:
if
const title = 5 if (title === 1) return if (title === 2) return if (title === 3) return if (title === 4) return if (title === 5) return
switch
const title = 5 switch (title) { case 1: return case 2: return case 3: return case 4: return case 5: return }