diff --git a/01/app.js b/01/app.js index e69de29..32ef371 100644 --- a/01/app.js +++ b/01/app.js @@ -0,0 +1,7 @@ +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..37898c8 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..286de92 100644 --- a/03/app.js +++ b/03/app.js @@ -0,0 +1,11 @@ +const sumNumbers = function(lastNumberToSum) { + let sum = 0; + + for (let i = 1; i <= lastNumberToSum; i++){ + sum += i; + } + return sum; +} + + +console.log(sumNumbers(4)); \ No newline at end of file diff --git a/04/app.js b/04/app.js index e69de29..1fb8783 100644 --- a/04/app.js +++ b/04/app.js @@ -0,0 +1,18 @@ +function runTimer(){ + + let counter = 0; + + const myInterval = setInterval(function(){ + const time = (new Date()).toLocaleTimeString(); + console.log(time); + counter++; + + if(counter > 4) { + clearInterval(myInterval) + } + },5000) +} + +runTimer(); + +