File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -644,11 +644,12 @@ server.
644
644
``` javascript
645
645
class BankAccount {
646
646
constructor () {
647
- this .balance = 1000 ;
647
+ this .balance = 1000 ;
648
648
}
649
649
}
650
650
651
651
let bankAccount = new BankAccount ();
652
+
652
653
// Buy shoes...
653
654
bankAccount .balance = bankAccount .balance - 100 ;
654
655
```
@@ -657,18 +658,19 @@ bankAccount.balance = bankAccount.balance - 100;
657
658
``` javascript
658
659
class BankAccount {
659
660
constructor () {
660
- this .balance = 1000 ;
661
+ this .balance = 1000 ;
661
662
}
662
663
663
664
// It doesn't have to be prefixed with `get` or `set` to be a getter/setter
664
665
withdraw (amount ) {
665
- if (verifyAmountCanBeDeducted (amount)) {
666
- this .balance -= amount;
667
- }
666
+ if (verifyAmountCanBeDeducted (amount)) {
667
+ this .balance -= amount;
668
+ }
668
669
}
669
670
}
670
671
671
672
let bankAccount = new BankAccount ();
673
+
672
674
// Buy shoes...
673
675
bankAccount .withdraw (100 );
674
676
```
You can’t perform that action at this time.
0 commit comments