diff --git a/01/app.js b/01/app.js index e69de29..41ba21d 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 diff --git a/02/app.js b/02/app.js index e69de29..a7e3b53 100644 --- a/02/app.js +++ b/02/app.js @@ -0,0 +1,5 @@ +function sayHello(name) { + console.log("Cześć " + name + "!") +} + +sayHello("devmentor.pl") \ No newline at end of file diff --git a/03/app.js b/03/app.js index e69de29..fc810a1 100644 --- a/03/app.js +++ b/03/app.js @@ -0,0 +1,9 @@ +const givenAmountOfNumbers = (x) => { + let sum = 0 + for (let i = 0; i <= x; i++) { + sum += i + } + return sum +} + +console.log(sumGivenAmontOfNumbers(4)) \ No newline at end of file diff --git a/04/app.js b/04/app.js index e69de29..f3c80a0 100644 --- a/04/app.js +++ b/04/app.js @@ -0,0 +1,13 @@ +let counter = 1 +let idInterval +const runTimer = () => { + const time = (new Date()).toLocaleTimeString(); + console.log(time); + counter++ + + if (counter > 5) { + clearInterval(idInterval) + } +} + +idInterval = setInterval(runTimer, 5000) \ No newline at end of file