=== "" vs .length > 0 vs .length === 0 (v28)

Revision 28 of this benchmark created by Rowan Thorpe on


Preparation HTML

<script>
window.str = "hey";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
=== ''
(str === "hey");
ready
.length > 0
(str.length > 0);
ready
.length === 0
(str.length === 0);
ready

Revisions

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