Equality operators (v10)

Revision 10 of this benchmark created by Tobias Reiss on


Description

Test for == and === with the same/diff operand types.

Preparation HTML

<script>
  var nul = null,
      foo = 12,
      bar = 12,
      baz = "12";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Non-strict equal
foo == bar;
ready
Strict equal
foo === bar;
ready
different types, coercion
foo == baz;
ready
different types, no coercion
foo === baz;
ready
Number == null
foo == nul
ready
Number === null
foo === null
ready
String == null
baz == null
ready
String === null
baz === null
ready

Revisions

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