Merge pull request #2118 from vsemozhetbyt/ch-1-2-8

Fix old link and excess line break in 1.2.8
This commit is contained in:
Ilya Kantor 2020-09-23 12:47:50 +03:00 committed by GitHub
commit 01e87b58a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -9,8 +9,7 @@ let b = "2"; // prompt("Second number?", 2);
alert(a + b); // 12 alert(a + b); // 12
``` ```
What we should do is to convert strings to numbers before `+`. For example, using `Number()` or What we should do is to convert strings to numbers before `+`. For example, using `Number()` or prepending them with `+`.
prepending them with `+`.
For example, right before `prompt`: For example, right before `prompt`:

View file

@ -180,7 +180,7 @@ Parentheses override any precedence, so if we're not satisfied with the default
There are many operators in JavaScript. Every operator has a corresponding precedence number. The one with the larger number executes first. If the precedence is the same, the execution order is from left to right. There are many operators in JavaScript. Every operator has a corresponding precedence number. The one with the larger number executes first. If the precedence is the same, the execution order is from left to right.
Here's an extract from the [precedence table](https://developer.mozilla.org/en/JavaScript/Reference/operators/operator_precedence) (you don't need to remember this, but note that unary operators are higher than corresponding binary ones): Here's an extract from the [precedence table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence) (you don't need to remember this, but note that unary operators are higher than corresponding binary ones):
| Precedence | Name | Sign | | Precedence | Name | Sign |
|------------|------|------| |------------|------|------|