In many places, I saw developers doing value == var comparisons, for example:
if ('https' === location.protocol) { port = 8443; protocol = 'wss://'; isSecure = true; }
I know that a == b same as b == a , so why do people use value == var instead of var == value ?
Is there a standard for this? And if so, what is the standard way?
javascript if-statement
Ash
source share