From 98c93ddfe9815c9228f358b6688ad069ee8f1fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Be=C5=82z?= Date: Tue, 15 Oct 2024 12:29:02 +0000 Subject: [PATCH 1/4] Done --- 01/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/01/app.js b/01/app.js index e69de29..1fc15b8 100644 --- a/01/app.js +++ b/01/app.js @@ -0,0 +1,6 @@ +function showTime() { + const time = (new Date()).toLocaleTimeString(); + console.log(time); +} + +showTime(); \ No newline at end of file From 7c832521afb8073d411b38c8bbe8c1966159ab13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Be=C5=82z?= Date: Tue, 15 Oct 2024 12:40:39 +0000 Subject: [PATCH 2/4] done --- 02/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/02/app.js b/02/app.js index e69de29..8feb101 100644 --- a/02/app.js +++ b/02/app.js @@ -0,0 +1,6 @@ + +function sayHello(name) { + console.log('Cześć ' + name + '!' ); +} + +sayHello('devmentor.pl'); \ No newline at end of file From 12a14c9773f4c717098e40e2d8fd53380863feaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Be=C5=82z?= Date: Tue, 15 Oct 2024 12:59:06 +0000 Subject: [PATCH 3/4] done --- 03/app.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/03/app.js b/03/app.js index e69de29..e3b5512 100644 --- a/03/app.js +++ b/03/app.js @@ -0,0 +1,11 @@ +const fn = function(stop) { + let sum = 0; + + for (let i = 1; i <= stop; i++) { + sum += i; + } + + return sum; +} + +console.log(fn(4)); From 3ae1934831ec4d6e78fff6542c8811c4288cf12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Be=C5=82z?= Date: Tue, 15 Oct 2024 13:19:57 +0000 Subject: [PATCH 4/4] done --- 04/app.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/04/app.js b/04/app.js index e69de29..cbc1bb8 100644 --- a/04/app.js +++ b/04/app.js @@ -0,0 +1,16 @@ +let idInterval; +let counter = 0; + + +const runTimer = function() { + const time = (new Date()).toLocaleTimeString(); + console.log(time); + + counter++; + + if (counter === 5) { + clearInterval(idInterval); + } +} + +idInterval = setInterval(runTimer, 1000);