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
Almost all mathematical operations convert values to numbers. A notable exception is the addition `+` operator. If one of the added values is a string, the other one is also converted to a string.
86
-
87
-
Then, it concatenates (joins) them:
88
-
89
-
```js run
90
-
alert( 1 + '2' ); // '12' (string to the right)
91
-
alert( '1' + 2 ); // '12' (string to the left)
92
-
```
93
-
94
-
This only happens when at least one of the arguments is a string. Otherwise, values are converted to numbers.
95
-
````
84
+
Most mathematical operators also perform such conversion, we'll see that in the next chapter.
0 commit comments