default operator

JavaScript performance comparison

Revision 3 of this test case created by

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
assign or (for falsy values)
var foo = 0;
foo = foo || 2;
pending…
or assign (for falsy values)
var foo = 0;
foo || (foo = 2);
pending…
if assign (for falsy values)
var foo = 0;
if (!foo) {
  foo = 2;
}
  
pending…
assign or (for truthy values)
var bar = 1;
bar = bar || 2;
pending…
or assign (for truthy values)
var bar = 1;
bar || (bar = 2);
pending…
if assign (for truthy values)
var bar = 1;
if (!bar) {
  bar = 2;
}
pending…

Compare results of other browsers

Revisions

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

0 Comments