Skip to content

Commit 4d30548

Browse files
authored
Merge pull request #1279 from theBearWhoCodes/terminology
clarify type conversion headings
2 parents 2d3f7cc + 7b7fdca commit 4d30548

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There are also cases when we need to explicitly convert a value to the expected
1010
In this chapter, we won't cover objects. Instead, we'll study primitives first. Later, after we learn about objects, we'll see how object conversion works in the chapter <info:object-toprimitive>.
1111
```
1212

13-
## ToString
13+
## To String
1414

1515
String conversion happens when we need the string form of a value.
1616

@@ -30,7 +30,7 @@ alert(typeof value); // string
3030

3131
String conversion is mostly obvious. A `false` becomes `"false"`, `null` becomes `"null"`, etc.
3232

33-
## ToNumber
33+
## To Number
3434

3535
Numeric conversion happens in mathematical functions and expressions automatically.
3636

@@ -94,7 +94,7 @@ alert( '1' + 2 ); // '12' (string to the left)
9494
This only happens when at least one of the arguments is a string. Otherwise, values are converted to numbers.
9595
````
9696

97-
## ToBoolean
97+
## To Boolean
9898

9999
Boolean conversion is the simplest one.
100100

@@ -129,9 +129,9 @@ alert( Boolean(" ") ); // spaces, also true (any non-empty string is true)
129129
130130
The three most widely used type conversions are to string, to number, and to boolean.
131131
132-
**`ToString`** -- Occurs when we output something. Can be performed with `String(value)`. The conversion to string is usually obvious for primitive values.
132+
**`To String`** -- Occurs when we output something. Can be performed with `String(value)`. The conversion to string is usually obvious for primitive values.
133133
134-
**`ToNumber`** -- Occurs in math operations. Can be performed with `Number(value)`.
134+
**`To Number`** -- Occurs in math operations. Can be performed with `Number(value)`.
135135
136136
The conversion follows the rules:
137137
@@ -142,7 +142,7 @@ The conversion follows the rules:
142142
|<code>true&nbsp;/&nbsp;false</code> | `1 / 0` |
143143
| `string` | The string is read "as is", whitespaces from both sides are ignored. An empty string becomes `0`. An error gives `NaN`. |
144144
145-
**`ToBoolean`** -- Occurs in logical operations. Can be performed with `Boolean(value)`.
145+
**`To Boolean`** -- Occurs in logical operations. Can be performed with `Boolean(value)`.
146146
147147
Follows the rules:
148148

0 commit comments

Comments
 (0)