Ternary function call

Benchmark created by Chester on


Preparation HTML

<script>
function one()
{ return 1 }

function two()
{ return 2 }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
If-else statements
if (2 == 2) one();
else two();
ready
Ternary
2 == 2 ? one() : two();
ready
Ternary 2
(2 == 2 ? one : two)()
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.