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:
Ilya Kantor 2021-06-20 09:02:02 +03:00 committed by GitHub
commit 8558fa8f5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,7 +116,7 @@ class CoffeeMachine {
let coffeeMachine = new CoffeeMachine(100);
// 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.