teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

コードを修正させて頂きましたm(__)m

2020/05/19 04:49

投稿

tanakashouzoux
tanakashouzoux

スコア52

title CHANGED
File without changes
body CHANGED
@@ -60,16 +60,18 @@
60
60
  const timeLeft = startTime + timeLimit - Date.now();
61
61
  timerLabel.textContent = (timeLeft / 1000).toFixed(2);
62
62
 
63
-
63
+ /*★*/
64
-  if (timeLeft < 0) {
64
+  if (timeLeft < 0) {
65
- clearTimeout(timerId);
65
+ clearTimeout(timerId);
66
- alert('Game over');
66
+ alert('Game over');
67
- ★}
68
-
69
- ☆ const timerId = setTimeout(updateTimer, 10);
70
-
71
67
  }
68
+ /*★*/
72
69
 
70
+ /*☆*/
71
+  const timerId = setTimeout(updateTimer, 10);
72
+ /*☆*/
73
+ }
74
+
73
75
  window.addEventListener('click', () => {
74
76
  target.textContent = word;
75
77
  startTime = Date.now();