Merge pull request #2638 from ZYinMD/patch-16
update one code comment in 1-js/09-classes/04-private-protected-properties-methods
This commit is contained in:
commit
8558fa8f5c
1 changed files with 1 additions and 1 deletions
|
@ -116,7 +116,7 @@ class CoffeeMachine {
|
||||||
let coffeeMachine = new CoffeeMachine(100);
|
let coffeeMachine = new CoffeeMachine(100);
|
||||||
|
|
||||||
// add water
|
// add water
|
||||||
coffeeMachine.waterAmount = -10; // Error: Negative water
|
coffeeMachine.waterAmount = -10; // _waterAmount will become 0, not -10
|
||||||
```
|
```
|
||||||
|
|
||||||
Now the access is under control, so setting the water amount below zero becomes impossible.
|
Now the access is under control, so setting the water amount below zero becomes impossible.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue