回答編集履歴
1
追記しました。
test
CHANGED
@@ -6,13 +6,15 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
|
9
|
+
function countup(count) {
|
10
10
|
|
11
|
-
|
11
|
+
if(count === undefined) {
|
12
|
+
|
13
|
+
count = 0;
|
14
|
+
|
15
|
+
}
|
12
16
|
|
13
17
|
if(count > 5) {
|
14
|
-
|
15
|
-
count = 0;
|
16
18
|
|
17
19
|
return;
|
18
20
|
|
@@ -20,15 +22,13 @@
|
|
20
22
|
|
21
23
|
console.log(count++);
|
22
24
|
|
23
|
-
setTimeout(countup, 1000);
|
25
|
+
setTimeout(countup, 1000, count);
|
24
26
|
|
25
27
|
}
|
26
28
|
|
27
|
-
}
|
29
|
+
}
|
28
30
|
|
29
31
|
countup();
|
30
|
-
|
31
|
-
|
32
32
|
|
33
33
|
```
|
34
34
|
|