Checking if true or false

JavaScript performance comparison

Test case created by and last updated

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var b=true;

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
01. Equals true
if(b==true){}
pending…
02. Equals true (strictly)
if(b===true){}
pending…
03. Equals false
if(b==false){}
pending…
04. Equals false (strictly)
if(b===false){}
pending…
05. Equals !0
if(b==!0){}
pending…
06. Equals !0 (strictly)
if(b===!0){}
pending…
07. Equals !1
if(b==!1){}
pending…
08. Equals !1 (strictly)
if(b===!1){}
pending…
09. Equals !!0
if(b==!!0){}
pending…
10. Equals !!0 (strictly)
if(b===!!0){}
pending…
11. Equals !!1
if(b==!!1){}
pending…
12. Equals !!1 (strictly)
if(b===!!1){}
pending…
13. Boolean()
if(Boolean(b)){}
pending…
14. if(b)
if(b){}
pending…
15. if(!b)
if(!b){}
pending…

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

Compare results of other browsers

0 Comments