ternary vs logical operators

Benchmark created on


Preparation HTML

<script>
  var foo = 0, bar = 5, baz = 10;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Ternary operator
foo && bar || baz
ready
Logical operators
foo ? bar : baz
ready

Revisions

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