Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

done #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

done #25

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/Node.js_challenge_dzien_1.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion app/test.js
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
console.log('Wygląda na to, że wszystko działa :)');
//
// setTimeout(() => {
// //Funkcja wykona się po 2s.
// console.log('Wygląda na to, że wszystko działa :)');
// }, 6000);

// setInterval(() => {
// //Funkcja wykona się co 1s.
// console.log('Wygląda na to, że wszystko działa :)');
// }, 1000);

// const text = 'Hello, World!';
//
// let counter = 0;
// //Program wyświetla po znaku z tekstu...
// const intervalId = setInterval(() => {
// console.log(text[counter]);
// counter++;
//
// //...ręcznie musimy mu powiedzieć kiedy należy przerwać wykonywanie - wtedy proces Node.js się zakończy
// if (counter === text.length){
// clearInterval(intervalId);
// }
// }, 400);

process.argv.forEach((val, index) => {
console.log(`${index}: ${val}`);
});
6 changes: 5 additions & 1 deletion app/zadanie01.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
//Twój kod
//Twój kod
console.log('Jurek D.');
setTimeout(() => {
console.log('wita się z Node.js!');
}, 5000)
31 changes: 30 additions & 1 deletion app/zadanie02.js
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
//Twój kod
//Twój kod
setTimeout(() => {
console.log('Node.js!');
}, 4000)

setTimeout(() => {
console.log('się');
}, 1000)

console.log('Witam');

setTimeout(() => {
console.log('i korzystam');
}, 6000)

setTimeout(() => {
console.log('w konsoli');
}, 5000)

setTimeout(() => {
console.log('z funkcji czasu!');
}, 7000)

setTimeout(() => {
console.log('z');
}, 2000)

setTimeout(() => {
console.log('programem');
}, 3000)
11 changes: 10 additions & 1 deletion app/zadanie03.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
//Twój kod
//Twój kod

let numOr0 = n => isNaN(n) ? 0 : n

const result = process.argv.reduce((acc, num) => {
return acc + numOr0(parseInt(num));
},0);

console.log(result);

7 changes: 6 additions & 1 deletion app/zadanieDnia.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
//Twój kod
//Twój kod

process.argv.forEach(num => {
setTimeout(() => {
console.log(num)}, num);
});