jQuery / Javascript if statement speed
Posted
by Sam
on Stack Overflow
See other posts from Stack Overflow
or by Sam
Published on 2010-06-17T15:31:08Z
Indexed on
2010/06/17
15:43 UTC
Read the original article
Hit count: 213
Given:
var
isIE = $.browser.msie && !$.support.opacity,
isIE6 = isIE && $.browser.version < 7;
Which would be faster:
if(isIE6){ doSomething(); }
else { doSomethingElse(); }
OR
if(!isIE6){ doSomethingElse(); }
else { doSomething(); }
Are they exactly the same in terms of speed?
© Stack Overflow or respective owner