diff --git a/app/test.js b/app/test.js index dffc25d..364bf93 100644 --- a/app/test.js +++ b/app/test.js @@ -1 +1,18 @@ -console.log('Wygląda na to, że wszystko działa :)'); \ No newline at end of file +console.log('Wygląda na to, że wszystko działa :)'); + +const text = 'Hello, World!'; + +let counter = 0; + +const intervalId = setInterval(() => { + console.log(text[counter]); + counter++; + + if (counter === text.length){ + clearInterval(intervalId); + } +}, 400); + +process.argv.forEach((element,index) => { + console.log(`${index}: ${element}`); +}); diff --git a/app/zadanie01.js b/app/zadanie01.js index 8c20173..8b4ef6b 100644 --- a/app/zadanie01.js +++ b/app/zadanie01.js @@ -1 +1,4 @@ -//Twój kod \ No newline at end of file +//Twój kod + +console.log('Arkadiusz Dziechciarz'); +setTimeout(() => console.log('wita się z Node.js'),5000); diff --git a/app/zadanie02.js b/app/zadanie02.js index 8c20173..d166814 100644 --- a/app/zadanie02.js +++ b/app/zadanie02.js @@ -1 +1,13 @@ -//Twój kod \ No newline at end of file +//Twój kod + +console.log('Witam'); + +let textArray = ['się','z','programem','Node.js','w konsoli','i korzystam','z funkcji czasu!']; +let counter = 0; +let myInterval = setInterval(() => { + console.log(`${textArray[counter]}`); + counter++; + if (counter == textArray.length-1){ + clearInterval(myInterval); + } +},1000); diff --git a/app/zadanie03.js b/app/zadanie03.js index 8c20173..5904d64 100644 --- a/app/zadanie03.js +++ b/app/zadanie03.js @@ -1 +1,6 @@ -//Twój kod \ No newline at end of file +//Twój kod + +let [element,index,...array] = [...process.argv]; + +let result = array.reduce((prev,next) => parseInt(prev,10)+parseInt(next,10)); +console.log(result); diff --git a/app/zadanieDnia.js b/app/zadanieDnia.js index 8c20173..9e64953 100644 --- a/app/zadanieDnia.js +++ b/app/zadanieDnia.js @@ -1 +1,7 @@ -//Twój kod \ No newline at end of file +//Twój kod + +let [element, index, ...array] = [...process.argv]; + +array.forEach((element) => { + setTimeout(() => {console.log(element)},parseInt(element,10)*1000); +});