Which is faster:
if (var == 'value')
or
if (/value/.test(var))
if(var == 'value')
. By a lot. But if you really want fast, do if(var === 'value')
. Strict equivalency has a lot less work to do than type-coerced equivalency.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With