Skip to content

Commit 077cff4

Browse files
authored
Merge pull request #480 from ut-code/change-to-compound-assignment-operator
Change to compound assignment operator
2 parents af7f81c + 20f8606 commit 077cff4

File tree

1 file changed

+3
-3
lines changed
  • docs/1-trial-session/09-functions

1 file changed

+3
-3
lines changed

docs/1-trial-session/09-functions/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function tryToDrive() {
9393
let guestCount = 0;
9494

9595
function greet() {
96-
guestCount = guestCount + 1;
96+
guestCount += 1;
9797
document.write("あなたは" + guestCount + "人目のお客様です。");
9898
}
9999

@@ -112,8 +112,8 @@ let outer = 0;
112112

113113
function increment() {
114114
let inner = 0;
115-
outer = outer + 1;
116-
inner = inner + 1;
115+
outer += 1;
116+
inner += 1;
117117
document.write(outer); // 1ずつ増える
118118
document.write(inner); // 常に1
119119
}

0 commit comments

Comments
 (0)