v = 1 - v

Benchmark created by Göran Andersson on


Preparation HTML

<script>
  var v = 1;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
v == 0 ? 1 : 0
v = v == 0 ? 1 : 0;
ready
v ? 0 : 1
v = v ? 0 : 1;
ready
+!v
v = +!v;
ready
1 - v
v = 1 - v;
ready
^=1
v ^= 1;
ready

Revisions

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