From f9ad7fd77227fae9c5f3d315bb7d7ab7122f293f Mon Sep 17 00:00:00 2001 From: clenclen Date: Tue, 9 Feb 2016 21:43:13 -0500 Subject: [PATCH 1/2] added js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit added js — exhausted. --- countdown.js | 22 ++++++++++++++++++++-- index.html | 3 ++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/countdown.js b/countdown.js index 3001c8d..6c0acae 100644 --- a/countdown.js +++ b/countdown.js @@ -1,5 +1,23 @@ -function countdown(seconds){ - // ... + +function countdown(seconds) { + + console.log(seconds) + + seconds-- + + if (seconds == 0) { + console.log ("Done"); + return + } else { + setTimeout(function(){ + countdown(seconds) + }, 1000); + } } countdown(5); + + + + + diff --git a/index.html b/index.html index ca28931..01fda70 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,11 @@ + Countdown exercise - See console. +
text 1
From 00864e11e1aa2d07bd6baba75e60c09a4be53f78 Mon Sep 17 00:00:00 2001 From: clenclen Date: Tue, 9 Feb 2016 23:01:11 -0500 Subject: [PATCH 2/2] kitchentimer.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit question regrading how the math in the “time” variable works. --- kitchentimer.html | 180 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 kitchentimer.html diff --git a/kitchentimer.html b/kitchentimer.html new file mode 100644 index 0000000..5c660f6 --- /dev/null +++ b/kitchentimer.html @@ -0,0 +1,180 @@ + + + + kitchen timer + + + + + + + + +
+
+
    +
  • 00:00:00
  • +
+
+
start
+
reset
+
+ + + + + + + + + + + + + + + + + + + + + +