Skip to content

Commit 7fe566c

Browse files
committed
Fix extra good example in getters and setters
1 parent 0951bc2 commit 7fe566c

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

README.md

-21
Original file line numberDiff line numberDiff line change
@@ -927,27 +927,6 @@ const bankAccount = new BankAccount();
927927
bankAccount.balance -= 100;
928928
```
929929

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-
951930
**Good**:
952931
```javascript
953932
class BankAccount {

0 commit comments

Comments
 (0)