Skip to content

Commit 09da2a9

Browse files
committed
content fixes, #1646
1 parent 6cc9b62 commit 09da2a9

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

Diff for: 1-js/02-first-steps/06-type-conversions/article.md

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Type Conversions
22

3-
Most of the time, operators and functions automatically convert the values given to them to the right type.
3+
Most of the time, operators and functions automatically convert the values given to them to the right type.
44

55
For example, `alert` automatically converts any value to a string to show it. Mathematical operations convert values to numbers.
66

@@ -81,18 +81,7 @@ alert( Number(false) ); // 0
8181

8282
Please note that `null` and `undefined` behave differently here: `null` becomes zero while `undefined` becomes `NaN`.
8383

84-
````smart header="Addition '+' concatenates strings"
85-
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.
9685

9786
## Boolean Conversion
9887

0 commit comments

Comments
 (0)