=== vs == for '' (v4)

Revision 4 of this benchmark created by Mike McCaughan on


Preparation HTML

<script>
  var a = '',
      b = '';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
=== for ''
if (a === '') {
 var c = '';
}
ready
== for ''
if (b == '') {
 var d = '';
}
ready
.length === 0 for ''
if (a.length === 0) {
 var e = '';
}
ready
.length == 0 for ''
if (a.length == 0) {
 var f = '';
}
ready

Revisions

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

  • Revision 1: published by Mike McCaughan on
  • Revision 2: published by Mike McCaughan on
  • Revision 3: published by Mike McCaughan on
  • Revision 4: published by Mike McCaughan on