You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+ can mean either addition or string concatenation depending on its operands. And if neither operand is a literal (a + b), it becomes a chore to figure out which behaviour is being denoted. In the most extreme cases, one can't even statically determine this. This leads to accidental addition being a common bug even among experienced ECMAScripters.
The text was updated successfully, but these errors were encountered:
When intending to do string concatenation, start with an empty string literal. So a + b becomes "" + a + b. When intending to do addition, prefix each operand with a unary plus: +a + +b. That one may get a little tedious.
+
can mean either addition or string concatenation depending on its operands. And if neither operand is a literal (a + b
), it becomes a chore to figure out which behaviour is being denoted. In the most extreme cases, one can't even statically determine this. This leads to accidental addition being a common bug even among experienced ECMAScripters.The text was updated successfully, but these errors were encountered: