Equality operators (v11)

Revision 11 of this benchmark created by Matthew Robb on


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
Number === Number()
bar === Number(baz)
ready
Number == Number()
bar == Number(baz)
ready

Revisions

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