var start = Date.now();
var val;
for(var i=0;i<1000000;i++){
        val=false;
        val=false;
}
console.log(Date.now()-start);

V8 (Node.js and Chrome) seems to optimize this loop out, so you can do a 
billion iterations really fast. Firefox gives a more realistic indication of 
performance:

This takes about 700 ms for a million iterations on my machine. Setting it once 
instead of twice cuts off about 100ms.

Harbs

> On Jun 11, 2017, at 10:56 AM, Justin Mclean <jus...@classsoftware.com> wrote:
> 
>> Safe, but inefficient at times.
> 
> So far I not seen any inefficiency in fact the opposite. But sure there may 
> be specific cases that perform better, please post any you find to the list.

Reply via email to