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

Dzień 1 #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
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('Radek Micinski');
let myTimeout = setTimeout(()=>{
console.log("Wita się z node.js")
},5000)
24 changes: 23 additions & 1 deletion app/zadanie02.js
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
//Twój kod
//Twój kod
console.log('Witam');
let myTimeout1 = setTimeout(()=>{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Działać - działa, ale dwie rzeczy

  1. Czy jakiś pomysł jak to zautomatyzować :) ?
  2. const będzie tu lepszy - nigdy nie potrzebujemy zmieniać raz dodanego timeout id.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dzięki :) już poprawiam rozwiązanie

console.log("się")
},1000);
let myTimeout2 = setTimeout(()=>{
console.log("z")
},2000);
let myTimeout3 = setTimeout(()=>{
console.log("programem")
},3000);
let myTimeout4 = setTimeout(()=>{
console.log("Node.js")
},4000);
let myTimeout5 = setTimeout(()=>{
console.log("w konsoli")
},5000);
let myTimeout6 = setTimeout(()=>{
console.log("i korzystam")
},6000);
let myTimeout7 = setTimeout(()=>{
console.log("z funkcji czasu!")
},7000);
8 changes: 7 additions & 1 deletion app/zadanie03.js
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
//Twój kod
//Twój kod

let result = 0;
for (let i=2; i<process.argv.length;i++){
result = result + Number(process.argv[i])
}
console.log(result)
10 changes: 9 additions & 1 deletion app/zadanieDnia.js
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
//Twój kod
//Twój kod



for(let i = 2; i<process.argv.length; i++){
setTimeout(()=>{
console.log(process.argv[i])
}, Number(process.argv[i])*1000)
}