Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info
This commit is contained in:
commit
225a36fd55
5 changed files with 7 additions and 22 deletions
|
|
@ -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.**
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue