5 ms·
Your template string logic doesn't actually mitigate the problem. Short-circuit evaluation in JavaScript means that `falsey && something_else` will always evalu
by ickelbawd 7y ago
Your template string logic doesn't actually mitigate the problem. Short-circuit evaluation in JavaScript means that `falsey && something_else` will always evaluate to `falsey` and then you'll still get undefined in your className string. You would have to use a ternary to avoid this.
- hjanssen 7y agoYes you are right, I have edited my post. It is pretty late.