diff --git a/app/test.js b/app/test.js index dffc25d..d1137a7 100644 --- a/app/test.js +++ b/app/test.js @@ -1 +1,21 @@ -console.log('Wygląda na to, że wszystko działa :)'); \ No newline at end of file +// setTimeout(()=>{ +// +// console.log('Wygląda na to, że wszystko działa :)'); +// },2000); + + +// 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((val, index) => { + console.log(`${index}: ${val}`); +}); \ No newline at end of file diff --git a/app/zadanie01.js b/app/zadanie01.js index 8c20173..526c570 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("Włodek"); + +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..32d829e 100644 --- a/app/zadanie02.js +++ b/app/zadanie02.js @@ -1 +1,78 @@ -//Twój kod \ No newline at end of file +// //Twój kod +// +// setTimeout(()=>{ +// console.log("Node.js") +// },4000); +// +// setTimeout(()=>{ +// console.log("się") +// },1000); +// +// setTimeout(()=>{ +// console.log("Witam") +// },); +// +// setTimeout(()=>{ +// console.log("i korzystam") +// },6000); +// +// setTimeout(()=>{ +// console.log("z funkcji czasu") +// },7000); +// +// setTimeout(()=>{ +// console.log("z") +// },2000); +// +// setTimeout(()=>{ +// console.log("programem") +// },3000); +// + +const sec = 1000; +const array = [ + { + txt: 'Node.js', + time: 4, + }, + { + txt: 'się', + time: 1, + }, + { + txt: 'Witam', + time: 0, + }, + { + txt: 'i korzystam', + time: 6, + }, + { + txt: 'w konsoli', + time: 5, + }, + { + txt: 'z funkcji czasu!', + time: 7, + }, + { + txt: 'z', + time: 2, + }, + { + txt: 'programem', + time: 3, + }, + ]; + + + +array.forEach(el => { + pokaz_text(el) +}); + +function pokaz_text(obj){ + setTimeout(()=>{ + console.log(obj.txt) + },obj.time * sec); +} \ No newline at end of file diff --git a/app/zadanie03.js b/app/zadanie03.js index 8c20173..196b1bc 100644 --- a/app/zadanie03.js +++ b/app/zadanie03.js @@ -1 +1,7 @@ -//Twój kod \ No newline at end of file +//Twój kod + +let sum = 0; +for (let i = 2; i { + console.log(time); + }, time * sec); + } \ No newline at end of file