Some people may prefer to reverse the order of values in the if
cause the second form is more protective.
In fact if you miss to type an equal sign:
if (42 = myVar) { }
throws a syntax error at compile time, while
if (myVar = 42) { }
evaluates the completion value of the assignment expression, 42
in this case, that is a truthy value in JavaScript.
Anyway a similar error today can be easily spotted with tools such as eslint... So there's no a real point for using first form.