Minus operation instead of minus sign
This commit is contained in:
parent
c693192018
commit
fb5c7b6fa7
1 changed files with 1 additions and 1 deletions
|
@ -17,6 +17,6 @@ undefined + 1 = NaN // (4)
|
||||||
```
|
```
|
||||||
|
|
||||||
1. The addition with a string `"" + 1` converts `1` to a string: `"" + 1 = "1"`, and then we have `"1" + 0`, the same rule is applied.
|
1. The addition with a string `"" + 1` converts `1` to a string: `"" + 1 = "1"`, and then we have `"1" + 0`, the same rule is applied.
|
||||||
2. The subtraction `"-"` (like most math operations) only works with numbers, it converts an empty string `""` to `0`.
|
2. The subtraction `-` (like most math operations) only works with numbers, it converts an empty string `""` to `0`.
|
||||||
3. `null` becomes `0` after the numeric conversion.
|
3. `null` becomes `0` after the numeric conversion.
|
||||||
4. `undefined` becomes `NaN` after the numeric conversion.
|
4. `undefined` becomes `NaN` after the numeric conversion.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue