minor
This commit is contained in:
parent
95597b8fda
commit
f643be326c
2 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ A [variable](https://en.wikipedia.org/wiki/Variable_(computer_science)) is a "na
|
||||||
|
|
||||||
To create a variable in JavaScript, use the `let` keyword.
|
To create a variable in JavaScript, use the `let` keyword.
|
||||||
|
|
||||||
The statement below creates (in other words: *declares* or *defines*) a variable with the name "message":
|
The statement below creates (in other words: *declares*) a variable with the name "message":
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let message;
|
let message;
|
||||||
|
|
|
@ -23,4 +23,4 @@ undefined + 1 = NaN // (6)
|
||||||
4. The subtraction always converts to numbers, so it makes `" -9 "` a number `-9` (ignoring spaces around it).
|
4. The subtraction always converts to numbers, so it makes `" -9 "` a number `-9` (ignoring spaces around it).
|
||||||
5. `null` becomes `0` after the numeric conversion.
|
5. `null` becomes `0` after the numeric conversion.
|
||||||
6. `undefined` becomes `NaN` after the numeric conversion.
|
6. `undefined` becomes `NaN` after the numeric conversion.
|
||||||
7. Space characters, such as `\t` and `\n`, are trimmed off string start and end when a string is converted to a number. So a string `\t \n`, similarly to an empty string, becomes `0`.
|
7. Space characters, are trimmed off string start and end when a string is converted to a number. Here the whole string consists of space characters, such as `\t`, `\n` and a "regular" space between them. So, similarly to an empty string, it becomes `0`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue