File tree
Expand file treeCollapse file tree1 file changed
+0
-21
lines changed Expand file treeCollapse file tree1 file changed
+0
-21
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -927,27 +927,6 @@ const bankAccount = new BankAccount();
|
927 | 927 | bankAccount.balance -= 100;
|
928 | 928 | ```
|
929 | 929 |
|
930 |
| -**Good**: |
931 |
| -```javascript |
932 |
| -class BankAccount { |
933 |
| -constructor() { |
934 |
| -this.balance = 1000; |
935 |
| -} |
936 |
| - |
937 |
| -// It doesn't have to be prefixed with `get` or `set` to be a getter/setter |
938 |
| -withdraw(amount) { |
939 |
| -if (verifyAmountCanBeDeducted(amount)) { |
940 |
| -this.balance -= amount; |
941 |
| -} |
942 |
| -} |
943 |
| -} |
944 |
| - |
945 |
| -const bankAccount = new BankAccount(); |
946 |
| - |
947 |
| -// Buy shoes... |
948 |
| -bankAccount.withdraw(100); |
949 |
| -``` |
950 |
| - |
951 | 930 | **Good**:
|
952 | 931 | ```javascript
|
953 | 932 | class BankAccount {
|
|
You can’t perform that action at this time.
0 commit comments