equal vs strict equal (v4)

Revision 4 of this benchmark created by Tim Oxley on


Description

Compare the performance of == vs ===

Preparation HTML

<script>
  var string = 'a string';
  var obj = {a: 'object', b: 0};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
== 'a string'
string == 'a string';
ready
=== 'a string'
string === 'a string';
ready
!= 'another string'
string != 'another string';
ready
!== 'another string'
string !== 'another string';
ready
== {a: 'object', b: 0}
obj == {a: 'object', b: 0};
ready
=== {a: 'object', b: 0}
obj === {a: 'object', b: 0};
ready
== {a: 'object', b: '0'}
obj == {a: 'object', b: '0'}
ready
=== {a: 'object', b: '0'}
obj === {a: 'object', b: '0'}
ready

Revisions

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