I couldn't understand how !a&&!b would be slower; the NOT should be included in the branch.<p>The Firefox JIT inspector suggested that the body of the loop was being entirely removed, which makes sense, because it doesn't do anything. A body more like this does the trick:<p><pre><code> if(!a&&!b) {tt+=1;} else {tf+=1;}
</code></pre>
You'll need to add the relevant declarations to the setup section.<p><pre><code> var tt=0,tf=0;
</code></pre>
(The assignment to a and b should probably go there, too - it's in the teardown section at the moment.)<p>The result, though, is still the same!<p>I fixed this by switching the bodies round, so that !a&&!b runs first, then !(a||b) runs second. Now !a&&!b is quicker, as it should be, and I feel vindicated. Sort of.