diff --git a/app/zadanie01.js b/app/zadanie01.js index 8c20173..fb62126 100644 --- a/app/zadanie01.js +++ b/app/zadanie01.js @@ -1 +1,7 @@ -//Twój kod \ No newline at end of file +//Twój kod + +console.log("Filip Godziński") + +const helloText = setTimeout( () => { + console.log("wita się z Node.js!"); +}, 5000); \ No newline at end of file diff --git a/app/zadanie02.js b/app/zadanie02.js index 8c20173..9a75f78 100644 --- a/app/zadanie02.js +++ b/app/zadanie02.js @@ -1 +1,18 @@ -//Twój kod \ No newline at end of file +//Twój kod + +const arrText = { + 4: "Node.js", + 1: "się", + 0: "Witam", + 6: "i korzystam", + 5: "w konsoli", + 7: "z funkcji czasu!", + 2: "z", + 3: "programem" +}; + +for (let i in arrText) { + setTimeout( () => { + console.log(arrText[i]); + }, i*1000); +} \ No newline at end of file diff --git a/app/zadanie03.js b/app/zadanie03.js index 8c20173..f11fdfc 100644 --- a/app/zadanie03.js +++ b/app/zadanie03.js @@ -1 +1,12 @@ -//Twój kod \ No newline at end of file +//Twój kod + +let sum = 0; + +const addition = process.argv.forEach( (element, index) => { + if (index >= 2) { + sum += Number(element); + } +}); + +console.log(sum); + diff --git a/app/zadanieDnia.js b/app/zadanieDnia.js index 8c20173..9b292bd 100644 --- a/app/zadanieDnia.js +++ b/app/zadanieDnia.js @@ -1 +1,9 @@ -//Twój kod \ No newline at end of file +//Twój kod + +const showNum = process.argv.forEach( (element, index) => { + if (index >= 2) { + setTimeout( () => { + console.log(Number(element)); + }, Number(element)*1000); + } +}); \ No newline at end of file