From 74144a49508276f1cf011b53ddf2dd29b02e6260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 14 Jan 2025 15:54:03 +0100 Subject: [PATCH 1/4] task 01 done --- .vscode/settings.json | 3 +++ 01/app.js | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/01/app.js b/01/app.js index e69de29..fd795bb 100644 --- a/01/app.js +++ b/01/app.js @@ -0,0 +1,7 @@ +function showTime() { + console.log(time); +} + +const time = (new Date()).toLocaleTimeString(); + +showTime(); \ No newline at end of file From e46b7c093591be66bd8702976193aae8101491a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 14 Jan 2025 15:57:51 +0100 Subject: [PATCH 2/4] task 02 done --- 02/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/02/app.js b/02/app.js index e69de29..7d20cc0 100644 --- a/02/app.js +++ b/02/app.js @@ -0,0 +1,7 @@ +function sayHello(name) { + console.log('Cześć ' + name); +} + +const name = 'devmentor.pl'; + +sayHello(name); \ No newline at end of file From 15620b410f405b9a9139d475d928182a280b1121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 14 Jan 2025 16:07:09 +0100 Subject: [PATCH 3/4] task 03 done --- 03/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/03/app.js b/03/app.js index e69de29..f0f52ab 100644 --- a/03/app.js +++ b/03/app.js @@ -0,0 +1,9 @@ +const sumNumUpTo = function(number) { + let sum = 0; + for(let i=1; i<=number; i++) { + sum = sum + i; + } + return sum; +} + +console.log(sumNumUpTo(4)); \ No newline at end of file From 1ee3764a979f63f4133ec3d836bfbc1c5c6d49ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 14 Jan 2025 16:28:38 +0100 Subject: [PATCH 4/4] task 04 done --- 04/app.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/04/app.js b/04/app.js index e69de29..4442201 100644 --- a/04/app.js +++ b/04/app.js @@ -0,0 +1,19 @@ +let counter = 0; + +function runTimer() { + const idInterval = setInterval(function() { + const time = (new Date()).toLocaleTimeString(); + console.log(time); + + counter++; + + if(counter === 5) { + clearInterval(idInterval); + } + + }, 5000); +} + +runTimer(); + +