v = 1 - v (v2)

Revision 2 of this benchmark created 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
1 ^ v
v = 1 ^ v;
ready

Revisions

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