Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info

This commit is contained in:
Ilya Kantor 2021-06-13 11:05:24 +03:00
commit 225a36fd55
5 changed files with 7 additions and 22 deletions

View file

@ -46,7 +46,7 @@ alert(3 +
+ 2);
```
The code outputs `6` because JavaScript does not insert semicolons here. It is intuitively obvious that if the line ends with a plus `"+"`, then it is an "incomplete expression", so the semicolon is not required. And in this case that works as intended.
The code outputs `6` because JavaScript does not insert semicolons here. It is intuitively obvious that if the line ends with a plus `"+"`, then it is an "incomplete expression", so a semicolon there would be incorrect. And in this case, that works as intended.
**But there are situations where JavaScript "fails" to assume a semicolon where it is really needed.**

View file

@ -192,7 +192,7 @@ There's a finished JavaScript proposal, almost in the standard, that provides la
Privates should start with `#`. They are only accessible from inside the class.
For instance, here's a private `#waterLimit` property and the water-checking private method `#checkWater`:
For instance, here's a private `#waterLimit` property and the water-checking private method `#fixWaterAmount`:
```js run
class CoffeeMachine {