Skip to content

Commit 847e340

Browse files
Merge pull request ryanmcdermott#94 from vsemozhetbyt/operator-assignment
use assignment operators
2 parents 3f94eb2 + d6b1a71 commit 847e340

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ class BankAccount {
924924
const bankAccount = new BankAccount();
925925

926926
// Buy shoes...
927-
bankAccount.balance = bankAccount.balance - 100;
927+
bankAccount.balance -= 100;
928928
```
929929

930930
**Good**:
@@ -2000,7 +2000,7 @@ function hashIt(data) {
20002000
// Make the hash
20012001
hash = ((hash << 5) - hash) + char;
20022002
// Convert to 32-bit integer
2003-
hash = hash & hash;
2003+
hash &= hash;
20042004
}
20052005
}
20062006
```
@@ -2017,7 +2017,7 @@ function hashIt(data) {
20172017
hash = ((hash << 5) - hash) + char;
20182018

20192019
// Convert to 32-bit integer
2020-
hash = hash & hash;
2020+
hash &= hash;
20212021
}
20222022
}
20232023

0 commit comments

Comments
 (0)