3 ms·
In most environments, writing something like `if (x = 5)` will generate a warning. E.g. if you use JSHint, you'd get: "Expected a conditional expression and i
by ahoge 13y ago
In most environments, writing something like `if (x = 5)` will generate a warning.
E.g. if you use JSHint, you'd get:
"Expected a conditional expression and instead saw an assignment."
Nowadays, there usually isn't any benefit in using yoda conditions.