Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
ternary vs partial ternary function
(version: 1)
Comparing performance of:
ternary vs partial ternary function
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const n = Math.random(); function partial(condition, trueCase, falseCase) { return condition ? trueCase(condition) : falseCase?.(condition) }
Tests:
ternary
const t1 = n > 0.5 ? true : false;
partial ternary function
const t2 = partial(n > 0.5, () => true)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
ternary
partial ternary function
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Browser/OS:
Firefox 138 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
ternary
1556472064.0 Ops/sec
partial ternary function
1460986240.0 Ops/sec
Related benchmarks:
If else ternary versus normal
Math.max/min vs if vs ternary operator vs custom function
Math.min vs. ternary
Math.max/min vs ternary operator (in functions)
Math.max/min vs function ternary vs inline ternary
if vs ternary vs multiplication
If/Else vs Ternary
ternary vs partial ternary in function
ternary vs partial ternary function v2
Comments
Confirm delete:
Do you really want to delete benchmark?