From b60ebc13408b981932f99d3c4dae24a5bbfdec8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wodniczak?= Date: Sat, 21 Sep 2024 12:36:21 +0200 Subject: [PATCH 1/4] added solution to 1 task --- 01/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/01/app.js b/01/app.js index e69de29..86e93fb 100644 --- a/01/app.js +++ b/01/app.js @@ -0,0 +1,8 @@ +const showTime = () => { + setInterval(() => { + const date = new Date() + console.log(date.toLocaleTimeString()) + }, 1000) +}; + +showTime(); \ No newline at end of file From bedd066d74538a4461b8f1b34a926db64e6c9e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wodniczak?= Date: Sat, 21 Sep 2024 12:48:22 +0200 Subject: [PATCH 2/4] added solution to 2 task --- 02/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/02/app.js b/02/app.js index e69de29..e981246 100644 --- a/02/app.js +++ b/02/app.js @@ -0,0 +1,5 @@ +const sayHello = (name) => { + console.log(`Witaj ${name}`) +} + +sayHello("devMentor.pl"); \ No newline at end of file From d203fb0ef9a790d5da975599373e4a7cf82c29c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wodniczak?= Date: Sat, 21 Sep 2024 12:55:17 +0200 Subject: [PATCH 3/4] added soltuion to 3 task --- 03/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/03/app.js b/03/app.js index e69de29..bddb3b0 100644 --- a/03/app.js +++ b/03/app.js @@ -0,0 +1,9 @@ +const sumNumber = function (n) { + let sum = 0; + for (let i = 1; i <= n; i++) { + sum += i; + } + return sum +} + +console.log(sumNumber(4)); \ No newline at end of file From b8d1c1aadd25809462ff0b9502ea9904daee7880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wodniczak?= Date: Sat, 21 Sep 2024 13:08:30 +0200 Subject: [PATCH 4/4] added solution to 4 task --- 04/app.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/04/app.js b/04/app.js index e69de29..830d088 100644 --- a/04/app.js +++ b/04/app.js @@ -0,0 +1,17 @@ +function runTime() { + let interval = 0 + const timeInterval = setInterval(() => { + const date = new Date(); + console.log(date.toLocaleTimeString()) + interval++ + + if (interval === 5) { + clearInterval(timeInterval); + console.log("interval przerwany"); + }; + }, 5000); +}; +runTime(); + + +