@@ -232,11 +232,12 @@ their content in quotes.
232232Both single and double quotes can be used to mark strings as long as
233233the quotes at the start and the end of the string match.
234234
235- (((newline)))Almost anything can be put between quotes, and JavaScript
236- will make a string value out of it. But a few characters are more
237- difficult. You can imagine how putting quotes between quotes might be
238- hard. _Newlines_ (the characters you get when you press Enter) also
239- can't be put between quotes. The string has to stay on a single line.
235+ (((newline character)))Almost anything can be put between quotes, and
236+ JavaScript will make a string value out of it. But a few characters
237+ are more difficult. You can imagine how putting quotes between quotes
238+ might be hard. _Newlines_ (the characters you get when you press
239+ Enter) also can't be put between quotes. The string has to stay on a
240+ single line.
240241
241242(((escaping,in strings)))(((backslash)))To be able to have such
242243characters in a string, the following notation is used: whenever a
@@ -245,7 +246,7 @@ character after it has a special meaning. This is called _escaping_
245246the character. A quote that is preceded by a backslash will not end
246247the string but be part of it. When an “n” character occurs after a
247248backslash, it is interpreted as a newline. Similarly, a “t” after a
248- backslash means a tab character. Take the following string:
249+ backslash means a (( tab character)) . Take the following string:
249250
250251[source,javascript]
251252----
@@ -494,15 +495,15 @@ console.log(false == 0)
494495// → true
495496----
496497
497- (((+ operator)))(((arithmetic)))(((* operator)))(((- operator)))When
498- an operator is applied to the “wrong” type of value, JavaScript will
499- quietly convert that value to the type it wants, using a set of rules
500- that often aren't what you want or expect. This is called _type
501- coercion_ . So the `null` in the first expression becomes `0`, and the
502- `"5"` in the second expression becomes `5` (from string to number).
503- Yet in the third expression, `+` tries string concatenation before
504- numeric addition, so the `1` is converted to `"1"` (from number to
505- string).
498+ (((+ operator)))(((arithmetic)))(((pass:[*] operator)))(((-
499+ operator)))When an operator is applied to the “wrong” type of value,
500+ JavaScript will quietly convert that value to the type it wants, using
501+ a set of rules that often aren't what you want or expect. This is
502+ called _((type coercion))_ . So the `null` in the first expression becomes
503+ `0`, and the ` "5"` in the second expression becomes `5` (from string
504+ to number). Yet in the third expression, `+` tries string
505+ concatenation before numeric addition, so the `1` is converted to
506+ `"1"` (from number to string).
506507
507508When something that doesn't map to a number in an obvious way (such as
508509`"five"` or `undefined`) is converted to a number, the value `NaN` is
@@ -532,17 +533,17 @@ That last piece of behavior is often useful. When you want to test
532533whether a value has a real value instead of `null` or `undefined`, you
533534can simply compare it to `null` with the `==` (or `!=`) operator.
534535
535- (((=== operator )))(((!== operator)))(((comparison)))But what if you
536- want to test whether something refers to the precise value `false`?
537- The rules for converting strings and numbers to Boolean values state
538- that `0`, `NaN`, and the empty string (`""`) count as `false`, while
539- all the other values count as `true`. Because of this, expressions
540- like `0 == false` and `"" == false` are also true. For cases like
541- this, where you do _not_ want any automatic type conversions to
542- happen, there are two extra operators: `===` and `!==`. The first
543- tests whether a value is precisely equal to the other, and the second
544- tests whether it is not precisely equal. So `"" === false` is false as
545- expected.
536+ (((Boolean type,conversion to )))(((=== operator)))(((!==
537+ operator)))(((comparison)))But what if you want to test whether
538+ something refers to the precise value `false`? The rules for
539+ converting strings and numbers to Boolean values state that `0`,
540+ `NaN`, and the empty string (`""`) count as `false`, while all the
541+ other values count as `true`. Because of this, expressions like `0 ==
542+ false` and `"" == false` are also true. For cases like this, where you
543+ do _not_ want any automatic type conversions to happen, there are two
544+ extra operators: `===` and `!==`. The first tests whether a value is
545+ precisely equal to the other, and the second tests whether it is not
546+ precisely equal. So `"" === false` is false as expected.
546547
547548I recommend using the three-character comparison operators defensively to
548549prevent unexpected type conversions from tripping you up. But when you're
0 commit comments