回答編集履歴
2
訂正
answer
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
--value;
|
27
27
|
closure();
|
28
28
|
closure();
|
29
|
-
console.log('
|
29
|
+
console.log('Outside: value is ' + value); // 2
|
30
30
|
```
|
31
31
|
|
32
32
|
##### 最新の外部の変数の値を参照するが,内部で起こった変更は無視する
|
1
訂正
answer
CHANGED
@@ -59,7 +59,7 @@
|
|
59
59
|
--value;
|
60
60
|
closure();
|
61
61
|
closure();
|
62
|
-
console.log('
|
62
|
+
console.log('Outside: value is ' + value); // 0
|
63
63
|
```
|
64
64
|
|
65
65
|
##### クロージャが作られたときの外部の変数の値を使用するが,内部で起こった変更は保持する
|
@@ -92,7 +92,7 @@
|
|
92
92
|
--value;
|
93
93
|
closure();
|
94
94
|
closure();
|
95
|
-
console.log('
|
95
|
+
console.log('Outside: value is ' + value); // 0
|
96
96
|
```
|
97
97
|
|
98
98
|
##### クロージャが作られたときの外部の変数の値を常に使用する
|
@@ -125,5 +125,5 @@
|
|
125
125
|
--value;
|
126
126
|
closure();
|
127
127
|
closure();
|
128
|
-
console.log('
|
128
|
+
console.log('Outside: value is ' + value); // 0
|
129
129
|
```
|