Skip to content

Commit 8558fa8

Browse files
authored
Merge pull request #2638 from ZYinMD/patch-16
update one code comment in 1-js/09-classes/04-private-protected-properties-methods
2 parents ffe91a6 + de36d0d commit 8558fa8

File tree

1 file changed

+1
-1
lines changed
  • 1-js/09-classes/04-private-protected-properties-methods

1 file changed

+1
-1
lines changed

1-js/09-classes/04-private-protected-properties-methods/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class CoffeeMachine {
116116
let coffeeMachine = new CoffeeMachine(100);
117117

118118
// add water
119-
coffeeMachine.waterAmount = -10; // Error: Negative water
119+
coffeeMachine.waterAmount = -10; // _waterAmount will become 0, not -10
120120
```
121121

122122
Now the access is under control, so setting the water amount below zero becomes impossible.

0 commit comments

Comments
 (0)