Triple equals vs Double equals (v4)

Revision 4 of this benchmark created on


Description

Check performance of === against ==.

Preparation HTML

<script>
  var s1 = 1;
  var s2 = '1';
  var s3 = 2;
  var s4 = '2';
  var s5 = 1;
var s6 = '1';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
===(int)
if (s1 === s5) {}
ready
==(int)
if (s1 == s5) {}
ready
==(string)
if (s2 == s6) {}
 
ready
===(string)
if (s2 === s6) {}
 
ready
=== (different type)
if (s1 === s2) {}
 
ready
== (different type)
if (s1 == s2) {}
 
ready

Revisions

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