diff --git a/01/app.js b/01/app.js index e69de29..eec84ec 100644 --- a/01/app.js +++ b/01/app.js @@ -0,0 +1,6 @@ +function showTime() { + const time = new Date().toLocaleTimeString(); + console.log(time); +} + +showTime(); diff --git a/02/app.js b/02/app.js index e69de29..4b1ba0d 100644 --- a/02/app.js +++ b/02/app.js @@ -0,0 +1,4 @@ +function sayHello(name) { + console.log(`hej ${name}`); +} +sayHello('Sebastian') \ No newline at end of file diff --git a/03/app.js b/03/app.js index e69de29..a05438a 100644 --- a/03/app.js +++ b/03/app.js @@ -0,0 +1,13 @@ +const getNumber = function (num) { + let result = 0 + + for (let i = 0; i <= num; i++) { + result = result + i + + } + return result +} + + +const sum = getNumber(4) +console.log(sum); \ No newline at end of file diff --git a/04/app.js b/04/app.js index e69de29..85bab8a 100644 --- a/04/app.js +++ b/04/app.js @@ -0,0 +1,17 @@ +const timeInterval = 5; +let counter = 0; +const stopInterval = 5; + +function runTime() { + const time = new Date().toLocaleTimeString(); + console.log(time); + + for (let i = 1; i <= timeInterval; i++) { + console.log(i); + + } +} + +setInterval(function () { + runTime(); +}, 2000); diff --git a/04/index.html b/04/index.html index 91b0568..6455447 100644 --- a/04/index.html +++ b/04/index.html @@ -7,6 +7,6 @@